fix: failing tests, typo, and missing .tap fn

This commit is contained in:
Sean Larkin 2017-12-15 23:46:41 -08:00
parent 54178cbc19
commit 6554845d18
5 changed files with 6 additions and 9 deletions

View File

@ -45,10 +45,9 @@ class AmdMainTemplatePlugin {
};
for(const template of [mainTemplate, chunkTemplate]) {
template.hooks.renderWithEntry("AmdMainTemplatePlugin", onRenderWithEntry);
template.hooks.renderWithEntry.tap("AmdMainTemplatePlugin", onRenderWithEntry);
}
mainTemplate.hooks.globalHashPaths.tap("AmdMainTemplatePlugin", paths => {
if(this.name) paths.push(this.name);
return paths;

View File

@ -27,7 +27,7 @@ class ExportPropertyMainTemplatePlugin {
};
for(const template of [mainTemplate, chunkTemplate]) {
template.hooks.renderWithEntry("ExportPropertyMainTemplatePlugin", onRenderWithEntry);
template.hooks.renderWithEntry.tap("ExportPropertyMainTemplatePlugin", onRenderWithEntry);
}
mainTemplate.hooks.hash.tap("ExportPropertyMainTemplatePlugin", hash => {

View File

@ -18,7 +18,6 @@ class SetVarMainTemplatePlugin {
chunkTemplate
} = compilation;
const onRenderWithEntry = (source, chunk, hash) => {
const varExpression = mainTemplate.getAssetPath(this.varExpression, {
hash,
@ -33,7 +32,7 @@ class SetVarMainTemplatePlugin {
};
for(const template of [mainTemplate, chunkTemplate]) {
template.hooks.renderWithEntry("SetVarMainTemplatePlugin", onRenderWithEntry);
template.hooks.renderWithEntry.tap("SetVarMainTemplatePlugin", onRenderWithEntry);
}
mainTemplate.hooks.globalHashPaths.tap("SetVarMainTemplatePlugin", paths => {

View File

@ -179,10 +179,10 @@ class UmdMainTemplatePlugin {
};
for(const template of [mainTemplate, chunkTemplate]) {
template.hooks.renderWithEntry("UmdMainTemplatePlugin", onRenderWithEntry);
template.hooks.renderWithEntry.tap("UmdMainTemplatePlugin", onRenderWithEntry);
}
mainTemplate.hooks.globalHasPaths.tap("UmdMainTemplatePlugin", (paths) => {
mainTemplate.hooks.globalHashPaths.tap("UmdMainTemplatePlugin", (paths) => {
if(this.names.root) paths = paths.concat(this.names.root);
if(this.names.amd) paths = paths.concat(this.names.amd);
if(this.names.commonjs) paths = paths.concat(this.names.commonjs);

View File

@ -17,7 +17,6 @@ class JsonpExportMainTemplatePlugin {
chunkTemplate
} = compilation;
const onRenderWithEntry = (source, chunk, hash) => {
const name = mainTemplate.getAssetPath(this.name || "", {
hash,
@ -27,7 +26,7 @@ class JsonpExportMainTemplatePlugin {
};
for(const template of [mainTemplate, chunkTemplate]) {
template.hooks.renderWithEntry("JsonpExportMainTemplatePlugin", onRenderWithEntry);
template.hooks.renderWithEntry.tap("JsonpExportMainTemplatePlugin", onRenderWithEntry);
}
mainTemplate.hooks.globalHashPaths.tap("JsonpExportMainTemplatePlugin", paths => {