Skip to content

Commit

Permalink
fix(docs): add examples folder to watch command
Browse files Browse the repository at this point in the history
  • Loading branch information
Hyperkid123 committed Mar 4, 2021
1 parent 15c8deb commit daeed2b
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions packages/docs/docs-generator.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ const generateReactMD = require('./generate-react-md');
const generateFunctionsMd = require('./generate-functions-md');

const COMPONENTS_JSON = 'component-docs.json';
const EXAMPLES_LOCATION = path.resolve(__dirname, './examples');

const navDest = path.resolve(__dirname, './components/navigation');

Expand Down Expand Up @@ -39,8 +40,8 @@ const args = process.argv.slice(2);

console.log('Generating MD files for components.\n');
if (args.includes('-w') || args.includes('--watch')) {
const target = path.resolve(__dirname, COMPONENTS_JSON);
console.log(`Watching: ${path.resolve(__dirname, COMPONENTS_JSON)}`);
const target = [ path.resolve(__dirname, COMPONENTS_JSON), EXAMPLES_LOCATION ];
console.log(`Watching: ${target}`);
const watcher = chokidar.watch(target);
watcher.on('add', () => {
run();
Expand Down

0 comments on commit daeed2b

Please sign in to comment.