Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit 14c4304

Browse files
committedSep 9, 2020
Fix component css reloading on any change
1 parent 929eebe commit 14c4304

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed
 

‎lib/virtual.js

+13
Original file line numberDiff line numberDiff line change
@@ -34,11 +34,24 @@ function VirtualModulesPlugin(compiler) {
3434
this._virtualFiles[file] = { stats: stats, contents: contents };
3535
setData(this._statStorage, file, [null, stats]);
3636
setData(this._readFileStorage, file, [null, contents]);
37+
compiler.fileTimestamps.set(file, +stats.mtime)
3738
};
3839
}
3940

4041
const watchRunHook = (watcher, callback) => {
4142
this._watcher = watcher.compiler || watcher;
43+
44+
var virtualFiles = this.compiler.inputFileSystem._virtualFiles;
45+
46+
if (virtualFiles) {
47+
Object.keys(virtualFiles).forEach(
48+
function(file) {
49+
var mtime = +virtualFiles[file].stats.mtime;
50+
compiler.fileTimestamps.set(file, mtime);
51+
}
52+
);
53+
}
54+
4255
callback();
4356
};
4457

0 commit comments

Comments
 (0)
Please sign in to comment.