iTowns / itowns

A Three.js-based framework written in Javascript/WebGL for visualizing 3D geospatial data
http://www.itowns-project.org
Other
1.07k stars 290 forks source link

Webpack: Stop watching node modules in dev mode #2264

Closed jailln closed 5 months ago

jailln commented 5 months ago

Description

Prevent webpack from watching for node modules changes in dev mode (inspired from the official doc)

Motivation and Context

I sometime get the following error when running npm start: Error: ENOSPC: System limit for number of file watchers reached, especially when I have other projects running with webpack at the same time. I found at that webpack is by default also looking for changes innode_modules/` which is in 99.9% of cases not useful and increases greatly the number of files to watch.

Desplandis commented 5 months ago

I stumbled upon a similar issue when experimenting with the generation of an ES bundle with webpack for our examples. I'm interested in how you did encounter such problem. x)

I agree with the fix, however when linking to a local dependency (e.g. when using yarn link), a rare use-case I concur, it's nice for webpack to watch for edits on this dependency. @mgermerie and I are currently doing this for our loaders.gl experimentation.

jailln commented 5 months ago

I stumbled upon it when running another app with webpack at the same time.

Ok I understand the usecase, but as you said it's quite rare. Should we still merge it and one can remove this ignored path when needed for specific use cases? WDYT? We could also think of something more elaborated (like configure it with options in the npm start command or such but I don't think it's worth it)

Desplandis commented 5 months ago

Erratum, it seems to not affect @mgermerie use-case. Nonetheless, I think we should merge it, this is a niche use-case and this PR could benefit to us all.