Skip to content

Commit

Permalink
Merge pull request #6844 from swederik/issue-6843
Browse files Browse the repository at this point in the history
Add handling for devtool source-map with library specified as Object
  • Loading branch information
sokra committed Mar 26, 2018
2 parents eba38f1 + 7fcd281 commit fc2feaf
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
Expand Up @@ -136,6 +136,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
@@ -0,0 +1 @@
it("should compile successfully when output.library is an object of type:name", function() {});
@@ -0,0 +1,11 @@
module.exports = {
devtool: "source-map",
output: {
library: {
root: "[name]",
amd: "[name]",
commonjs: "[name]"
},
libraryTarget: "umd"
}
};

0 comments on commit fc2feaf

Please sign in to comment.