Skip to content

Commit

Permalink
fix: Add handling for devtool source-map with library specified as Ob…
Browse files Browse the repository at this point in the history
…ject (#6843)
  • Loading branch information
swederik committed Mar 23, 2018
1 parent d668a23 commit 7fcd281
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 0 deletions.
2 changes: 2 additions & 0 deletions lib/WebpackOptionsDefaulter.js
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,8 @@ class WebpackOptionsDefaulter extends OptionsDefaulter {
this.set("output.devtoolNamespace", "make", options => {
if (Array.isArray(options.output.library))
return options.output.library.join(".");
else if (typeof options.output.library === "object")
return options.output.library.root || "";
return options.output.library || "";
});
this.set("output.libraryTarget", "var");
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
it("should compile successfully when output.library is an object of type:name", function() {});
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
module.exports = {
devtool: "source-map",
output: {
library: {
root: "[name]",
amd: "[name]",
commonjs: "[name]"
},
libraryTarget: "umd"
}
};

0 comments on commit 7fcd281

Please sign in to comment.