Skip to content

Commit

Permalink
refactor: Use getAssetPath instead of calling the hook directly
Browse files Browse the repository at this point in the history
  • Loading branch information
jantimon committed Nov 11, 2019
1 parent 2595a79 commit a2ad30a
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/compiler.js
Original file line number Diff line number Diff line change
Expand Up @@ -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}`
Expand Down Expand Up @@ -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
});
Expand Down

0 comments on commit a2ad30a

Please sign in to comment.