Description
Hi dear devs and contributors.
I've noticed this behavior trying to reduce watch mode reload times when using tailwind+postcss through svelte-preprocess by monitoring with speed monitoring webpack plugin.
On any non-component change in the project with 20 components that uses in-component css there's 40 seconds of wait due to reloading of all Component.svelte.css
in _virtualFiles
.
I've been messing around with virtual.js
for some hours trying to fix this.
Tried to pass fs.statSync(this.resourcePath)
's to use with virtual css file. Though that non-authentic VirtualFileStats triggered watcher to reload. Didn't work.
console.logged contents of _statStorage
, _readFileStorage
, _virtualFiles
in compiler.inputFileSystem.purge
and compiler.inputFileSystem._writeVirtualFile
.
It appears that original purge doesn't clear any of that containers, commenting it's code doesn't change anything.
compiler.inputFileSystem.purge
does trigger on any change.
Lines 15 to 30 in 929eebe
While we at it, what is the purpose of this?
Lines 40 to 49 in 929eebe
Also there's an issue with similar task and problem, where author solved it by decorating NodeWatchFileSystem
.
webpack/webpack#5824
Don't know if that is a good idea...
The main question is why watcher reloads virtual css files when they weren't changed...
Would like to get some insight into this.