Skip to content

Commit

Permalink
feat(examples): resolve node_modules of examples in website
Browse files Browse the repository at this point in the history
  • Loading branch information
mrMetalWood committed Jan 23, 2024
1 parent b5c8eea commit 6b26043
Show file tree
Hide file tree
Showing 5 changed files with 278 additions and 10 deletions.
12 changes: 12 additions & 0 deletions scripts/install-examples.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
#!/usr/bin/env bash

rootDir="$(cd -P "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)"

for d in `find ${rootDir}/examples -type d -depth 1` ; do
echo ">>> installing example '$(basename $d)'"
(
cd $d
npm ci --silent
)

done
7 changes: 6 additions & 1 deletion website/docusaurus.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
const {resolve} = require('path');
const webpack = require('webpack');
const {themes: prismThemes} = require('prism-react-renderer');
const {globSync} = require('glob');

/** @type {import('@docusaurus/types').Config} */
const config = {
Expand Down Expand Up @@ -44,7 +45,11 @@ const config = {
{
debug: true,
resolve: {
modules: [resolve('node_modules'), resolve('../node_modules')],
modules: [
resolve('node_modules'),
resolve('../node_modules'),
...globSync('../examples/*/node_modules')
],
alias: {
'@vis.gl/react-google-maps': resolve('../src'),
'website-examples': resolve('../examples'),
Expand Down
256 changes: 255 additions & 1 deletion website/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 6b26043

Please sign in to comment.