Skip to content

Commit a2ad30a

Browse files
committed
refactor: Use getAssetPath instead of calling the hook directly
1 parent 2595a79 commit a2ad30a

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

lib/compiler.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -179,7 +179,7 @@ class HtmlWebpackChildCompiler {
179179
*/
180180
function extractHelperFilesFromCompilation (mainCompilation, childCompilation, filename, childEntryChunks) {
181181
const helperAssetNames = childEntryChunks.map((entryChunk, index) => {
182-
return mainCompilation.mainTemplate.hooks.assetPath.call(filename, {
182+
return mainCompilation.mainTemplate.getAssetPath(filename, {
183183
hash: childCompilation.hash,
184184
chunk: entryChunk,
185185
name: `HtmlWebpackPlugin_${index}`
@@ -261,7 +261,7 @@ function compileTemplate (templatePath, outputFilename, mainCompilation) {
261261
if (!compiledTemplates[templatePath]) console.log(Object.keys(compiledTemplates), templatePath);
262262
const compiledTemplate = compiledTemplates[templatePath];
263263
// Replace [hash] placeholders in filename
264-
const outputName = mainCompilation.mainTemplate.hooks.assetPath.call(outputFilename, {
264+
const outputName = mainCompilation.mainTemplate.getAssetPath(outputFilename, {
265265
hash: compiledTemplate.hash,
266266
chunk: compiledTemplate.entry
267267
});

0 commit comments

Comments
 (0)