Skip to content

Commit bc41e60

Browse files
committed
options defaulter returns new object
1 parent 4a541e0 commit bc41e60

3 files changed

Lines changed: 4 additions & 5 deletions

File tree

‎lib/OptionsDefaulter.js‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ class OptionsDefaulter {
3030
}
3131

3232
process(options) {
33-
// TODO: change this for webpack 4: options = Object.assign({}, options);
33+
options = Object.assign({}, options);
3434
for(let name in this.defaults) {
3535
switch(this.config[name]) {
3636
case undefined:
@@ -56,7 +56,7 @@ class OptionsDefaulter {
5656
throw new Error("OptionsDefaulter cannot process " + this.config[name]);
5757
}
5858
}
59-
// TODO: change this for webpack 4: return options;
59+
return options;
6060
}
6161

6262
set(name, config, def) {

‎lib/webpack.js‎

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,7 @@ function webpack(options, callback) {
2222
if(Array.isArray(options)) {
2323
compiler = new MultiCompiler(options.map(options => webpack(options)));
2424
} else if(typeof options === "object") {
25-
// TODO webpack 4: process returns options
26-
new WebpackOptionsDefaulter().process(options);
25+
options = new WebpackOptionsDefaulter().process(options);
2726

2827
compiler = new Compiler();
2928
compiler.context = options.context;

‎test/Compiler-caching.test.js‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ describe("Compiler (caching)", function() {
1212
this.timeout(15000);
1313

1414
function compile(entry, options, callback) {
15-
new WebpackOptionsDefaulter().process(options);
15+
options = new WebpackOptionsDefaulter().process(options);
1616
options.entry = entry;
1717
options.context = path.join(__dirname, "fixtures");
1818
options.output.path = "/";

0 commit comments

Comments
 (0)