Skip to content

Commit

Permalink
fix: fix "compilation.emitAsset" with more than 1 HtmlWebpackPlugins (#…
Browse files Browse the repository at this point in the history
…236)

Co-authored-by: xiaoweili <xiaoweili@tencent.com>
  • Loading branch information
leon776 and xiaoweili committed Mar 8, 2022
1 parent 87590ef commit e84e7d5
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/index.js
Expand Up @@ -33,7 +33,9 @@ function addFileToAssetsWebpack5(filename, compilation) {
.then(rawSource => {
const basename = path.basename(resolvedFilename);
compilation.fileDependencies.add(resolvedFilename);
compilation.emitAsset(basename, rawSource);
if (!compilation.getAsset(basename)) {
compilation.emitAsset(basename, rawSource);
}
return basename;
});
}
Expand Down

0 comments on commit e84e7d5

Please sign in to comment.