fixes and performance improvements

This commit is contained in:
Tobias Koppers 2016-01-26 17:56:44 +01:00
parent 186d0da5ce
commit 205d08cac5
5 changed files with 15 additions and 8 deletions

View File

@ -20,7 +20,7 @@ function NormalModuleFactory(context, resolvers, parser, options) {
this.plugin("factory", function() {
var _this = this;
return function(result, callback) {
var resolver = _this.applyPluginsWaterfall("resolver", null);
var resolver = _this.applyPluginsWaterfall0("resolver", null);
// Ignored
if(!resolver) return callback();
@ -53,7 +53,7 @@ function NormalModuleFactory(context, resolvers, parser, options) {
);
}
createdModule = _this.applyPluginsWaterfall("module", createdModule);
createdModule = _this.applyPluginsWaterfall0("module", createdModule);
return callback(null, createdModule);
});
@ -161,7 +161,7 @@ NormalModuleFactory.prototype.create = function(context, dependency, callback) {
// Ignored
if(!result) return callback();
var factory = _this.applyPluginsWaterfall("factory", null);
var factory = _this.applyPluginsWaterfall0("factory", null);
// Ignored
if(!factory) return callback();

View File

@ -71,6 +71,7 @@ function WebpackOptionsDefaulter() {
this.set("node.__dirname", "mock");
this.set("resolve", {});
this.set("resolve.unsafeCache", true);
this.set("resolve.modules", ["node_modules"]);
this.set("resolve.extensions", [".js", ".json"]);
this.set("resolve.aliasFields", "make", function(options) {
@ -87,6 +88,7 @@ function WebpackOptionsDefaulter() {
});
this.set("resolveLoader", {});
this.set("resolveLoader.unsafeCache", true);
this.set("resolveLoader.mainFields", ["loader", "main"]);
this.set("resolveLoader.extensions", [".js", ".json"]);
this.set("resolveLoader.moduleExtensions", ["-loader"]);

View File

@ -7,7 +7,7 @@
"acorn": "^2.4.0",
"async": "^1.3.0",
"clone": "^1.0.2",
"enhanced-resolve": "^2.0.0",
"enhanced-resolve": "^2.2.0",
"interpret": "^1.0.0",
"loader-runner": "^2.1.0",
"loader-utils": "^0.2.11",

View File

@ -149,13 +149,13 @@ describe("TestCases", function() {
module: {
loaders: [{
test: /\.json$/,
loader: "json"
loader: "json-loader"
}, {
test: /\.coffee$/,
loader: "coffee"
loader: "coffee-loader"
}, {
test: /\.jade$/,
loader: "jade"
loader: "jade-loader"
}]
},
plugins: (config.plugins || []).concat(

View File

@ -1,3 +1,8 @@
module.exports = {
target: "web"
target: "web",
module: {
loaders: [
{ test: /\.json$/, loader: "json-loader" }
]
}
};