diff --git a/docs/development/watching.md b/docs/development/watching.md index 9a388392f..0857553be 100644 --- a/docs/development/watching.md +++ b/docs/development/watching.md @@ -59,3 +59,9 @@ To solve some issues with running on docker container providers set this: ```ts fuse.run({ chokidar: { awaitWriteFinish: true } }); ``` + +This will allow you to stop the watcher from looking in folders like node_modules: + +```ts +fuse.run({ chokidarPaths: ['path'] ); +``` diff --git a/src/core/BundleProducer.ts b/src/core/BundleProducer.ts index 95bd3f6b5..b0366975c 100644 --- a/src/core/BundleProducer.ts +++ b/src/core/BundleProducer.ts @@ -30,14 +30,16 @@ export class BundleProducer { public entryPackageFile: string; private injectedCode = new Map(); private chokidarOptions: any; + private chokidarPaths: any; private warnings = new Map(); constructor(public fuse: FuseBox) { this.runner = new BundleRunner(this.fuse); } - public run(opts: { chokidar?: any; runType?: string }): Promise { + public run(opts: { chokidar?: any; chokidarPaths?: any; runType?: string }): Promise { if (opts) { this.chokidarOptions = opts.chokidar; + this.chokidarPaths = opts.chokidarPaths; } /** Collect information about watchers and start watching */ @@ -190,7 +192,7 @@ export class BundleProducer { let ready = false; chokidar - .watch(this.fuse.context.homeDir, this.chokidarOptions || {}) + .watch(this.chokidarPaths || this.fuse.context.homeDir, this.chokidarOptions || {}) .on("all", (event, fp) => { if (ready) { this.onChanges(settings, fp);