Added tests and fixed spelling error causing initial tests to fail

This commit is contained in:
Larkin Family 2016-02-27 01:01:49 -06:00
parent 164e33bd86
commit 86c5947904
3 changed files with 5 additions and 3 deletions

0
bin/webpack.js Normal file → Executable file
View File

View File

@ -22,11 +22,11 @@ function accessorAccess(base, accessor, joinWith) {
}).join(joinWith || "; ");
}
function LibraryTemplatePlugin(name, target, umdNamedDefine, auxilaryComment) {
function LibraryTemplatePlugin(name, target, umdNamedDefine, auxiliaryComment) {
this.name = name;
this.target = target;
this.umdNamedDefine = umdNamedDefine;
this.auxilaryComment = auxilaryComment;
this.auxiliaryComment = auxiliaryComment;
}
module.exports = LibraryTemplatePlugin;
LibraryTemplatePlugin.prototype.apply = function(compiler) {
@ -65,7 +65,7 @@ LibraryTemplatePlugin.prototype.apply = function(compiler) {
compilation.apply(new UmdMainTemplatePlugin(this.name, {
optionalAmdExternalAsGlobal: this.target === "umd2",
namedDefine: this.umdNamedDefine,
auxilaryComment: this.auxilaryComment
auxiliaryComment: this.auxiliaryComment
}));
break;
case "jsonp":

View File

@ -108,6 +108,8 @@ 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 || "")) +