purge only changed files, longer caching
This commit is contained in:
parent
209f96c543
commit
3cb3cf7285
|
@ -12,10 +12,15 @@ function NodeEnvironmentPlugin() {
|
||||||
module.exports = NodeEnvironmentPlugin;
|
module.exports = NodeEnvironmentPlugin;
|
||||||
NodeEnvironmentPlugin.prototype.apply = function(compiler) {
|
NodeEnvironmentPlugin.prototype.apply = function(compiler) {
|
||||||
compiler.inputFileSystem = new NodeJsInputFileSystem();
|
compiler.inputFileSystem = new NodeJsInputFileSystem();
|
||||||
compiler.inputFileSystem = new CachedInputFileSystem(compiler.inputFileSystem, 6000);
|
var inputFileSystem = compiler.inputFileSystem = new CachedInputFileSystem(compiler.inputFileSystem, 60000);
|
||||||
compiler.resolvers.normal.fileSystem = compiler.inputFileSystem;
|
compiler.resolvers.normal.fileSystem = compiler.inputFileSystem;
|
||||||
compiler.resolvers.context.fileSystem = compiler.inputFileSystem;
|
compiler.resolvers.context.fileSystem = compiler.inputFileSystem;
|
||||||
compiler.resolvers.loader.fileSystem = compiler.inputFileSystem;
|
compiler.resolvers.loader.fileSystem = compiler.inputFileSystem;
|
||||||
compiler.outputFileSystem = new NodeOutputFileSystem();
|
compiler.outputFileSystem = new NodeOutputFileSystem();
|
||||||
compiler.watchFileSystem = new NodeWatchFileSystem(compiler.inputFileSystem);
|
compiler.watchFileSystem = new NodeWatchFileSystem(compiler.inputFileSystem);
|
||||||
|
compiler.plugin("run", function(compiler, callback) {
|
||||||
|
if(compiler.inputFileSystem === inputFileSystem)
|
||||||
|
inputFileSystem.purge();
|
||||||
|
callback();
|
||||||
|
});
|
||||||
};
|
};
|
|
@ -201,8 +201,13 @@ NodeWatchFileSystem.prototype.watch = function(files, dirs, startTime, delay, ca
|
||||||
function onTimeout() {
|
function onTimeout() {
|
||||||
change = function() {};
|
change = function() {};
|
||||||
if(closed) return;
|
if(closed) return;
|
||||||
if(inputFileSystem && inputFileSystem.purge) inputFileSystem.purge();
|
var outdatedFiles = Object.keys(filesModified).sort();
|
||||||
callback(null, Object.keys(filesModified).sort(), Object.keys(dirsModified).sort(), fileTimestamps, dirTimestamps);
|
var outdatedDirs = Object.keys(dirsModified).sort();
|
||||||
|
if(inputFileSystem && inputFileSystem.purge) {
|
||||||
|
inputFileSystem.purge(outdatedFiles);
|
||||||
|
inputFileSystem.purge(outdatedDirs);
|
||||||
|
}
|
||||||
|
callback(null, outdatedFiles, outdatedDirs, fileTimestamps, dirTimestamps);
|
||||||
|
|
||||||
close();
|
close();
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
{
|
{
|
||||||
"name": "webpack",
|
"name": "webpack",
|
||||||
"version": "0.10.0-beta11",
|
"version": "0.10.0-beta12",
|
||||||
"author": "Tobias Koppers @sokra",
|
"author": "Tobias Koppers @sokra",
|
||||||
"description": "Packs CommonJs/AMD/Labeled Modules for the browser. Allows to split your codebase into multiple bundles, which can be loaded on demand. Support loaders to preprocess files, i.e. json, jade, coffee, css, less, ... and your custom stuff.",
|
"description": "Packs CommonJs/AMD/Labeled Modules for the browser. Allows to split your codebase into multiple bundles, which can be loaded on demand. Support loaders to preprocess files, i.e. json, jade, coffee, css, less, ... and your custom stuff.",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
|
|
Loading…
Reference in New Issue