Skip to content

Commit b3bc542

Browse files
committed
warn users when passing a weird object as options
i. e. when passing a es6 module like webpack#2376
1 parent 8f54cbc commit b3bc542

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

lib/webpack.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,9 @@ function webpack(options, callback) {
1515
return webpack(options);
1616
}));
1717
} else if(typeof options === "object") {
18+
if(!options.entry && !options.plugins) {
19+
throw new Error("Passed 'options' object don't look like a valid webpack configuration");
20+
}
1821
new WebpackOptionsDefaulter().process(options);
1922

2023
compiler = new Compiler();

0 commit comments

Comments
 (0)