| 617 | * @returns {CompilationAssets} new assets |
| 618 | */ |
| 619 | const popNewAssets = (assets) => { |
| 620 | /** @type {undefined | CompilationAssets} */ |
| 621 | let newAssets; |
| 622 | for (const file of Object.keys(assets)) { |
| 623 | if (savedAssets.has(file)) continue; |
| 624 | if (newAssets === undefined) { |
| 625 | newAssets = Object.create(null); |
| 626 | } |
| 627 | /** @type {CompilationAssets} */ |
| 628 | (newAssets)[file] = assets[file]; |
| 629 | savedAssets.add(file); |
| 630 | } |
| 631 | return /** @type {CompilationAssets} */ (newAssets); |
| 632 | }; |
| 633 | processAssetsHook.intercept({ |
| 634 | name: "Compilation", |
| 635 | call: () => { |