mirror of
https://github.com/facebook/docusaurus.git
synced 2025-05-21 21:16:59 +02:00
fix: blog file should trigger reload
This commit is contained in:
parent
221023fd51
commit
dc1e417db8
4 changed files with 38 additions and 14 deletions
|
@ -31,10 +31,14 @@ module.exports = async function start(siteDir, cliOptions = {}) {
|
|||
console.error(chalk.red(err.stack));
|
||||
});
|
||||
};
|
||||
const fsWatcher = chokidar.watch(['../docs/**/*.md', 'siteConfig.js'], {
|
||||
cwd: siteDir,
|
||||
ignoreInitial: true
|
||||
});
|
||||
const docsRelativeDir = props.siteConfig.customDocsPath || 'docs';
|
||||
const fsWatcher = chokidar.watch(
|
||||
[`../${docsRelativeDir}/**/*.md`, 'blog/**/*.md', 'siteConfig.js'],
|
||||
{
|
||||
cwd: siteDir,
|
||||
ignoreInitial: true
|
||||
}
|
||||
);
|
||||
fsWatcher.on('add', reload);
|
||||
fsWatcher.on('change', reload);
|
||||
fsWatcher.on('unlink', reload);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue