Skip to content

Commit c3198a9

Browse files
author
Sean Larkin
committed
Changed logic so that empty lines of
'// \n' don't appear in UMD wrapper
1 parent ff168bb commit c3198a9

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

‎lib/UmdMainTemplatePlugin.js‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -110,10 +110,10 @@ UmdMainTemplatePlugin.prototype.apply = function(compilation) {
110110

111111
return new ConcatSource(new OriginalSource(
112112
"(function webpackUniversalModuleDefinition(root, factory) {\n" +
113-
" //" + (this.auxiliaryComment && typeof this.auxiliaryComment === 'string' ? this.auxiliaryComment : (this.auxiliaryComment.commonjs2 || "")) + "\n" +
113+
(this.auxiliaryComment && typeof this.auxiliaryComment === 'string' ? " //" + this.auxiliaryComment + "\n" : (" //" + this.auxiliaryComment.commonjs2 + "\n" || "")) +
114114
" if(typeof exports === 'object' && typeof module === 'object')\n" +
115115
" module.exports = factory(" + externalsRequireArray("commonjs2") + ");\n" +
116-
" //" + (this.auxiliaryComment && typeof this.auxiliaryComment === 'string' ? this.auxiliaryComment : (this.auxiliaryComment.amd || "")) + "\n" +
116+
(this.auxiliaryComment && typeof this.auxiliaryComment === 'string' ? " //" + this.auxiliaryComment + "\n" : (" //" + this.auxiliaryComment.amd + "\n" || "")) +
117117
" else if(typeof define === 'function' && define.amd)\n" +
118118
(requiredExternals.length > 0 ?
119119
(this.name && this.namedDefine === true ?
@@ -126,12 +126,12 @@ UmdMainTemplatePlugin.prototype.apply = function(compilation) {
126126
)
127127
) +
128128
(this.name ?
129-
" //" + (this.auxiliaryComment && typeof this.auxiliaryComment === 'string' ? this.auxiliaryComment : (this.auxiliaryComment.commonjs || "")) + "\n" +
129+
(this.auxiliaryComment && typeof this.auxiliaryComment === 'string' ? " //" + this.auxiliaryComment + "\n" : (" //" + this.auxiliaryComment.commonjs + "\n" || "")) +
130130
" else if(typeof exports === 'object')\n" +
131131
" exports[" + libraryName(this.name) + "] = factory(" + externalsRequireArray("commonjs") + ");\n" +
132132
" else\n" +
133133
" " + replaceKeys(accessorAccess("root", this.name)) + " = factory(" + externalsRootArray(externals) + ");\n" :
134-
" //" + (this.auxiliaryComment && typeof this.auxiliaryComment === 'string' ? this.auxiliaryComment : (this.auxiliaryComment.root || "")) + "\n" +
134+
(this.auxiliaryComment && typeof this.auxiliaryComment === 'string' ? " //" + this.auxiliaryComment + "\n" : (" //" + this.auxiliaryComment.root + "\n" || "")) +
135135
" else {\n" +
136136
(externals.length > 0 ?
137137
" var a = typeof exports === 'object' ? factory(" + externalsRequireArray("commonjs") + ") : factory(" + externalsRootArray(externals) + ");\n" :

0 commit comments

Comments
 (0)