From a2ad30ae9ea66157b7e21f441e9adbbf9085d9b2 Mon Sep 17 00:00:00 2001 From: Jan Nicklas Date: Mon, 11 Nov 2019 16:13:45 +0100 Subject: [PATCH] refactor: Use getAssetPath instead of calling the hook directly --- lib/compiler.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/compiler.js b/lib/compiler.js index 89603602..a13abf3d 100644 --- a/lib/compiler.js +++ b/lib/compiler.js @@ -179,7 +179,7 @@ class HtmlWebpackChildCompiler { */ function extractHelperFilesFromCompilation (mainCompilation, childCompilation, filename, childEntryChunks) { const helperAssetNames = childEntryChunks.map((entryChunk, index) => { - return mainCompilation.mainTemplate.hooks.assetPath.call(filename, { + return mainCompilation.mainTemplate.getAssetPath(filename, { hash: childCompilation.hash, chunk: entryChunk, name: `HtmlWebpackPlugin_${index}` @@ -261,7 +261,7 @@ function compileTemplate (templatePath, outputFilename, mainCompilation) { if (!compiledTemplates[templatePath]) console.log(Object.keys(compiledTemplates), templatePath); const compiledTemplate = compiledTemplates[templatePath]; // Replace [hash] placeholders in filename - const outputName = mainCompilation.mainTemplate.hooks.assetPath.call(outputFilename, { + const outputName = mainCompilation.mainTemplate.getAssetPath(outputFilename, { hash: compiledTemplate.hash, chunk: compiledTemplate.entry });