Skip to content

Commit fc2feaf

Browse files
authored
Merge pull request webpack#6844 from swederik/issue-6843
Add handling for devtool source-map with library specified as Object
2 parents eba38f1 + 7fcd281 commit fc2feaf

File tree

3 files changed

+14
-0
lines changed

3 files changed

+14
-0
lines changed

lib/WebpackOptionsDefaulter.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -136,6 +136,8 @@ class WebpackOptionsDefaulter extends OptionsDefaulter {
136136
this.set("output.devtoolNamespace", "make", options => {
137137
if (Array.isArray(options.output.library))
138138
return options.output.library.join(".");
139+
else if (typeof options.output.library === "object")
140+
return options.output.library.root || "";
139141
return options.output.library || "";
140142
});
141143
this.set("output.libraryTarget", "var");
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
it("should compile successfully when output.library is an object of type:name", function() {});
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
module.exports = {
2+
devtool: "source-map",
3+
output: {
4+
library: {
5+
root: "[name]",
6+
amd: "[name]",
7+
commonjs: "[name]"
8+
},
9+
libraryTarget: "umd"
10+
}
11+
};

0 commit comments

Comments
 (0)