Skip to content

Commit 7fcd281

Browse files
committed
fix: Add handling for devtool source-map with library specified as Object (webpack#6843)
1 parent d668a23 commit 7fcd281

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
@@ -134,6 +134,8 @@ class WebpackOptionsDefaulter extends OptionsDefaulter {
134134
this.set("output.devtoolNamespace", "make", options => {
135135
if (Array.isArray(options.output.library))
136136
return options.output.library.join(".");
137+
else if (typeof options.output.library === "object")
138+
return options.output.library.root || "";
137139
return options.output.library || "";
138140
});
139141
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)