purge only changed files, longer caching
This commit is contained in:
parent
209f96c543
commit
3cb3cf7285
|
@ -12,10 +12,15 @@ function NodeEnvironmentPlugin() {
|
|||
module.exports = NodeEnvironmentPlugin;
|
||||
NodeEnvironmentPlugin.prototype.apply = function(compiler) {
|
||||
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.context.fileSystem = compiler.inputFileSystem;
|
||||
compiler.resolvers.loader.fileSystem = compiler.inputFileSystem;
|
||||
compiler.outputFileSystem = new NodeOutputFileSystem();
|
||||
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() {
|
||||
change = function() {};
|
||||
if(closed) return;
|
||||
if(inputFileSystem && inputFileSystem.purge) inputFileSystem.purge();
|
||||
callback(null, Object.keys(filesModified).sort(), Object.keys(dirsModified).sort(), fileTimestamps, dirTimestamps);
|
||||
var outdatedFiles = Object.keys(filesModified).sort();
|
||||
var outdatedDirs = Object.keys(dirsModified).sort();
|
||||
if(inputFileSystem && inputFileSystem.purge) {
|
||||
inputFileSystem.purge(outdatedFiles);
|
||||
inputFileSystem.purge(outdatedDirs);
|
||||
}
|
||||
callback(null, outdatedFiles, outdatedDirs, fileTimestamps, dirTimestamps);
|
||||
|
||||
close();
|
||||
}
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "webpack",
|
||||
"version": "0.10.0-beta11",
|
||||
"version": "0.10.0-beta12",
|
||||
"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.",
|
||||
"dependencies": {
|
||||
|
|
Loading…
Reference in New Issue