fix(v2): enable plugin not having pathsToWatch (#1305)

This commit is contained in:
Endilie Yacop Sucipto 2019-03-25 15:07:00 +07:00 committed by GitHub
parent 72242dddf4
commit 290ccc5315
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -47,8 +47,12 @@ module.exports = async function start(siteDir, cliOptions = {}) {
};
const {plugins} = props;
const docsRelativeDir = props.siteConfig.customDocsPath;
const pluginPaths = _.flatten(
plugins.map(plugin => plugin.getPathsToWatch()),
const pluginPaths = _.compact(
_.flatten(
plugins.map(
plugin => plugin.getPathsToWatch && plugin.getPathsToWatch(),
),
),
);
const fsWatcher = chokidar.watch(
[