diff --git a/lib/UmdMainTemplatePlugin.js b/lib/UmdMainTemplatePlugin.js index d6f9bfac4..742c68b26 100644 --- a/lib/UmdMainTemplatePlugin.js +++ b/lib/UmdMainTemplatePlugin.js @@ -108,14 +108,12 @@ UmdMainTemplatePlugin.prototype.apply = function(compilation) { amdFactory = "factory"; } - console.log("AUXILIARY COMMENT DAMNIT", this.auxiliaryComment); - return new ConcatSource(new OriginalSource( "(function webpackUniversalModuleDefinition(root, factory) {\n" + - " //" + (this.auxiliaryComment && typeof this.auxiliaryComment === 'string' ? this.auxiliaryComment : (this.auxiliaryComment.commonjs2 || "")) + + " //" + (this.auxiliaryComment && typeof this.auxiliaryComment === 'string' ? this.auxiliaryComment : (this.auxiliaryComment.commonjs2 || "")) + "\n" + " if(typeof exports === 'object' && typeof module === 'object')\n" + " module.exports = factory(" + externalsRequireArray("commonjs2") + ");\n" + - " //" + (this.auxiliaryComment && typeof this.auxiliaryComment === 'string' ? this.auxiliaryComment : (this.auxiliaryComment.amd || "")) + + " //" + (this.auxiliaryComment && typeof this.auxiliaryComment === 'string' ? this.auxiliaryComment : (this.auxiliaryComment.amd || "")) + "\n" + " else if(typeof define === 'function' && define.amd)\n" + (requiredExternals.length > 0 ? (this.name && this.namedDefine === true ? @@ -128,12 +126,12 @@ UmdMainTemplatePlugin.prototype.apply = function(compilation) { ) ) + (this.name ? - " //" + (this.auxiliaryComment && typeof this.auxiliaryComment === 'string' ? this.auxiliaryComment : (this.auxiliaryComment.commonjs || "")) + + " //" + (this.auxiliaryComment && typeof this.auxiliaryComment === 'string' ? this.auxiliaryComment : (this.auxiliaryComment.commonjs || "")) + "\n" + " else if(typeof exports === 'object')\n" + " exports[" + libraryName(this.name) + "] = factory(" + externalsRequireArray("commonjs") + ");\n" + " else\n" + " " + replaceKeys(accessorAccess("root", this.name)) + " = factory(" + externalsRootArray(externals) + ");\n" : - " //" + (this.auxiliaryComment && typeof this.auxiliaryComment === 'string' ? this.auxiliaryComment : (this.auxiliaryComment.root || "")) + + " //" + (this.auxiliaryComment && typeof this.auxiliaryComment === 'string' ? this.auxiliaryComment : (this.auxiliaryComment.root || "")) + "\n" + " else {\n" + (externals.length > 0 ? " var a = typeof exports === 'object' ? factory(" + externalsRequireArray("commonjs") + ") : factory(" + externalsRootArray(externals) + ");\n" :