This commit is contained in:
Tobias Koppers 2013-02-04 15:58:04 +01:00
parent eda45fe115
commit fd7226ed50
5 changed files with 14 additions and 6 deletions

View File

@ -195,7 +195,7 @@ Compilation.prototype.addEntry = function process(context, entry, name, callback
callback();
}.bind(this);
if(!(entry instanceof Dependency))
if(!(typeof entry == "object" && entry != null && entry.Class))
return callback(new Error("Parameter 'entry' must be a Dependency"));
var moduleFactory = this.dependencyFactories.get(entry.Class);

View File

@ -227,6 +227,10 @@ Compiler.prototype.createChildCompiler = function(compilation, compilerName, out
return childCompiler;
};
Compiler.prototype.isChild = function() {
return !!this.parentCompilation;
};
Compiler.prototype.createCompilation = function() {
return new Compilation(this);
};

View File

@ -16,6 +16,7 @@ ProgressPlugin.prototype.apply = function(compiler) {
handler(0.1 + (doneModules / Math.max(lastModulesCount, moduleCount)) * 0.6, doneModules + "/" + moduleCount + " build modules");
}
compiler.plugin("compilation", function(compilation) {
if(compilation.compiler.isChild()) return;
lastModulesCount = moduleCount;
moduleCount = 0;
doneModules = 0;

View File

@ -137,7 +137,7 @@ NodeWatchFileSystem.prototype.watch = function(files, dirs, startTime, delay, ca
fileTimestamps[item.path] = ts;
if(ts >= startTime) {
item.dirty = true;
change();
change(item.path);
}
callback(ts);
});
@ -146,25 +146,26 @@ NodeWatchFileSystem.prototype.watch = function(files, dirs, startTime, delay, ca
if(err) {
item.dirty = true;
if(item.type == 2) dirTimestamps[item.path] = Infinity;
change();
change(item.path);
return callback(Infinity);
}
traverse(item.path, files, function(ts) {
if(item.type == 2) dirTimestamps[item.path] = ts;
if(ts >= startTime) {
item.dirty = true;
change();
if(item.type == 2) change(item.path);
}
return callback(ts);
});
});
function flagAllDirty(item) {
if(item.children) {
if(item.children && item.children.length > 0) {
item.children.forEach(function(i) {
i.dirty = true;
if(i.type == 1) fileTimestamps[i.path] = Infinity;
else if(i.type == 2) dirTimestamps[i.path] = Infinity;
});
change(item.path);
}
}
function traverse(basePath, files, callback) {
@ -188,6 +189,7 @@ NodeWatchFileSystem.prototype.watch = function(files, dirs, startTime, delay, ca
fileTimestamps[childItem.path] = ts;
if(ts >= startTime) {
childItem.dirty = true;
change(childItem.path);
}
return callback(null, ts);
} else {
@ -202,6 +204,7 @@ NodeWatchFileSystem.prototype.watch = function(files, dirs, startTime, delay, ca
dirTimestamps[childItem.path] = ts;
if(ts >= startTime) {
childItem.dirty = true;
if(childItem.type == 2) change(childItem.path);
}
return callback(null, ts);
});

View File

@ -1,6 +1,6 @@
{
"name": "webpack",
"version": "0.9.0-beta8",
"version": "0.9.0-beta9",
"author": "Tobias Koppers @sokra",
"description": "Packs CommonJs/AMD 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": {