I have two projects: App and Library. App depends on Library. I'm working on both simultaneously, using yalc
so that when I update Library, it will update App/node-modules/Library.
Unfortunately, Webpack caches node_modules aggressively, and it won't pick up changes to App/node-modules/Library. Reloading App doesn't help, or even killing the watch and restarting it, because it's keeping the cache in the filesystem. I read somewhere that a change to package-lock.json
or yarn.lock
would invalidate them, but yalc has its own separate lockfile.
What works:
- Setting
cache
tofalse
. - Setting
snapshot.managedPaths
to[]
. - Stopping the watch, deleting the Webpack cache, and restarting.
What doesn't work:
- Adding
yalc.lock
tocache.buildDependencies
. (It causes a rebuild, but still uses the cached node_modules.)
Is there any way to configure Webpack so that it will invalidate its cache of node_modules if there is a change to yalc.lock?