Skip to content
This repository has been archived by the owner on Jun 20, 2023. It is now read-only.

Commit

Permalink
fix: allow fine tuning of chokidar to prevent ENOSPC errors (#1384)
Browse files Browse the repository at this point in the history
* fix: allow fine tuning of chokidar to prevent ENOSPC errors

* fix: documentation updated for chokidarPaths
  • Loading branch information
Josh Pike authored and nchanged committed Sep 14, 2018
1 parent d8b50f8 commit 563765a
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
6 changes: 6 additions & 0 deletions docs/development/watching.md
Expand Up @@ -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'] );
```
6 changes: 4 additions & 2 deletions src/core/BundleProducer.ts
Expand Up @@ -30,14 +30,16 @@ export class BundleProducer {
public entryPackageFile: string;
private injectedCode = new Map<string, string>();
private chokidarOptions: any;
private chokidarPaths: any;
private warnings = new Map<string, string[]>();
constructor(public fuse: FuseBox) {
this.runner = new BundleRunner(this.fuse);
}

public run(opts: { chokidar?: any; runType?: string }): Promise<BundleProducer> {
public run(opts: { chokidar?: any; chokidarPaths?: any; runType?: string }): Promise<BundleProducer> {
if (opts) {
this.chokidarOptions = opts.chokidar;
this.chokidarPaths = opts.chokidarPaths;
}

/** Collect information about watchers and start watching */
Expand Down Expand Up @@ -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);
Expand Down

0 comments on commit 563765a

Please sign in to comment.