8000 fix: allow fine tuning of chokidar to prevent ENOSPC errors (#1384) · fuse-box/fuse-box@563765a · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content
This repository was archived by the owner on Jun 20, 2023. It is now read-only.

Commit 563765a

Browse files
Josh Pikenchanged
authored andcommitted
fix: allow fine tuning of chokidar to prevent ENOSPC errors (#1384)
* fix: allow fine tuning of chokidar to prevent ENOSPC errors * fix: documentation updated for chokidarPaths
1 parent d8b50f8 commit 563765a

File tree

2 files changed

+10
-2
lines changed

2 files changed

+10
-2
lines changed

docs/development/watching.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,3 +59,9 @@ To solve some issues with running on docker container providers set this:
5959
```ts
6060
fuse.run({ chokidar: { awaitWriteFinish: true } });
6161
```
62+
63+
This will allow you to stop the watcher from looking in folders like node_modules:
64+
65+
```ts
66+
fuse.run({ chokidarPaths: ['path'] );
67+
```

src/core/BundleProducer.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,14 +30,16 @@ export class BundleProducer {
3030
public entryPackageFile: string;
3131
private injectedCode = new Map<string, string>();
3232
private chokidarOptions: any;
33+
private chokidarPaths: any;
3334
private warnings = new Map<string, string[]>();
3435
constructor(public fuse: FuseBox) {
3536
this.runner = new BundleRunner(this.fuse);
3637
}
3738

38-
public run(opts: { chokidar?: any; runType?: string }): Promise<BundleProducer> {
39+
public run(opts: { chokidar?: any; chokidarPaths?: any; runType?: string }): Promise<BundleProducer> {
3940
if (opts) {
4041
this.chokidarOptions = opts.chokidar;
42+
this.chokidarPaths = opts.chokidarPaths;
4143
}
4244

4345
/** Collect information about watchers and start w 729A atching */
@@ -190,7 +192,7 @@ export class BundleProducer {
190192

191193
let ready = false;
192194
chokidar
193-
.watch(this.fuse.context.homeDir, this.chokidarOptions || {})
195+
.watch(this.chokidarPaths || this.fuse.context.homeDir, this.chokidarOptions || {})
194196
.on("all", (event, fp) => {
195197
if (ready) {
196198
this.onChanges(settings, fp);

0 commit comments

Comments
 (0)
0