Merge branch 'kinka-webpack'

This commit is contained in:
Tobias Koppers 2015-08-09 12:20:36 +02:00
commit 6cf2d3f2a5
2 changed files with 15 additions and 1 deletions

View File

@ -193,6 +193,19 @@ module.exports = function(optimist, argv, convertOptions) {
}
function loadPlugin(name) {
var loadUtils = require("loader-utils");
var args = null;
try {
var p = name && name.indexOf("?");
if (p > -1) {
args = loadUtils.parseQuery(name.substring(p));
name = name.substring(0, p);
}
} catch(e) {
console.log("Invalid plugin arguments" + e + ".");
process.exit(-1);
}
var path;
try {
path = resolve.sync(process.cwd(), name);
@ -208,7 +221,7 @@ module.exports = function(optimist, argv, convertOptions) {
throw e;
}
try {
return new Plugin();
return new Plugin(args);
} catch(e) {
console.log("Cannot instantiate plugin " + name + ". (" + path + ")");
throw e;

View File

@ -41,6 +41,7 @@
"js-beautify": "^1.5.10",
"json-loader": "~0.5.1",
"less-loader": "^2.0.0",
"loader-utils": "^0.2.11",
"mocha": "~2.2.0",
"mocha-lcov-reporter": "0.0.2",
"raw-loader": "~0.5.0",