Skip to content

Commit 8738b8d

Browse files
author
Sean Larkin
committed
Merge branch 'master' of https://github.com/TheLarkInn/webpack
2 parents 4513b7d + 6daa860 commit 8738b8d

3 files changed

Lines changed: 8 additions & 8 deletions

File tree

lib/UmdMainTemplatePlugin.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -147,15 +147,15 @@ UmdMainTemplatePlugin.prototype.apply = function(compilation) {
147147
) +
148148
" else if(typeof exports === 'object')\n" +
149149
" exports[" + libraryName(this.name) + "] = factory(" + externalsRequireArray("commonjs") + ");\n" +
150-
" else\n" +
151-
" " + replaceKeys(accessorAccess("root", this.name)) + " = factory(" + externalsRootArray(externals) + ");\n" :
152150
(this.auxiliaryComment &&
153151
typeof this.auxiliaryComment === 'string' ?
154152
" //" + this.auxiliaryComment + "\n" :
155153
this.auxiliaryComment.root ?
156154
" //" + this.auxiliaryComment.root + "\n" :
157155
""
158156
) +
157+
" else\n" +
158+
" " + replaceKeys(accessorAccess("root", this.name)) + " = factory(" + externalsRootArray(externals) + ");\n" :
159159
" else {\n" +
160160
(externals.length > 0 ?
161161
" var a = typeof exports === 'object' ? factory(" + externalsRequireArray("commonjs") + ") : factory(" + externalsRootArray(externals) + ");\n" :

test/configCases/target/umd-auxiliary-comments-object/index.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@ it("should have auxiliary comments", function() {
66
var fs = require("fs");
77
var source = fs.readFileSync(__filename, "utf-8");
88

9-
source.should.containEql("//test comment commonjs");
10-
source.should.containEql("//test comment commonjs2");
11-
source.should.containEql("//test comment amd");
12-
source.should.containEql("//test comment root");
9+
source.should.containEql("//test " + "comment " + "commonjs");
10+
source.should.containEql("//test " + "comment " + "commonjs2");
11+
source.should.containEql("//test " + "comment " + "amd");
12+
source.should.containEql("//test " + "comment " + "root");
1313
});

test/configCases/target/umd-auxiliary-comments-string/index.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,6 @@ it("should run", function() {
55
it("should have auxiliary comment string", function() {
66
var fs = require("fs");
77
var source = fs.readFileSync(__filename, "utf-8");
8-
9-
source.should.containEql("//test comment");
8+
9+
source.should.containEql("//test " + "comment");
1010
});

0 commit comments

Comments
 (0)