Skip to content

Commit b46da21

Browse files
committed
move plugins before environment
1 parent 59fb750 commit b46da21

2 files changed

Lines changed: 5 additions & 5 deletions

File tree

‎lib/WebpackOptionsApply.js‎

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -56,10 +56,6 @@ WebpackOptionsApply.prototype.constructor = WebpackOptionsApply;
5656

5757
WebpackOptionsApply.prototype.process = function(options, compiler) {
5858
var ExternalsPlugin;
59-
compiler.context = options.context;
60-
if(options.plugins && Array.isArray(options.plugins)) {
61-
compiler.apply.apply(compiler, options.plugins);
62-
}
6359
compiler.outputPath = options.output.path;
6460
compiler.recordsInputPath = options.recordsInputPath || options.recordsPath;
6561
compiler.recordsOutputPath = options.recordsOutputPath || options.recordsPath;

‎lib/webpack.js‎

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,10 +25,14 @@ function webpack(options, callback) {
2525
new WebpackOptionsDefaulter().process(options);
2626

2727
compiler = new Compiler();
28+
compiler.context = options.context;
29+
compiler.options = options;
2830
new NodeEnvironmentPlugin().apply(compiler);
31+
if(options.plugins && Array.isArray(options.plugins)) {
32+
compiler.apply.apply(compiler, options.plugins);
33+
}
2934
compiler.applyPlugins("environment");
3035
compiler.applyPlugins("after-environment");
31-
compiler.options = options;
3236
compiler.options = new WebpackOptionsApply().process(options, compiler);
3337
} else {
3438
throw new Error("Invalid argument: options");

0 commit comments

Comments
 (0)