Skip to content

Commit

Permalink
refactor: avoid guard (#1801)
Browse files Browse the repository at this point in the history
  • Loading branch information
alexander-akait committed Jun 10, 2023
1 parent 7ecf1eb commit 432e6a0
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions index.js
Expand Up @@ -712,10 +712,7 @@ function hookIntoCompiler (compiler, options, plugin) {
const entryPointUnfilteredFiles = compilation.entrypoints.get(entryName).getFiles();

const entryPointFiles = entryPointUnfilteredFiles.filter((chunkFile) => {
// compilation.getAsset was introduced in webpack 4.4.0
// once the support pre webpack 4.4.0 is dropped please
// remove the following guard:
const asset = compilation.getAsset && compilation.getAsset(chunkFile);
const asset = compilation.getAsset(chunkFile);
if (!asset) {
return true;
}
Expand Down

0 comments on commit 432e6a0

Please sign in to comment.