Merge remote-tracking branch 'origin/main' into feat/v9-prerelease

This commit is contained in:
Nathan Walker
2025-11-03 22:20:44 -08:00
2 changed files with 78 additions and 6 deletions

View File

@@ -89,7 +89,14 @@ export default class FixSourceMapUrlPlugin {
compiler.hooks.thisCompilation.tap(
'FixSourceMapUrlPlugin',
(compilation: any) => {
const stage = wp.Compilation.PROCESS_ASSETS_STAGE_DEV_TOOLING;
// IMPORTANT:
// Run AFTER SourceMapDevToolPlugin has emitted external map assets.
// If we run at DEV_TOOLING and replace sources, we may drop mapping info
// before Webpack has a chance to write .map files. SUMMARIZE happens later.
const stage =
wp.Compilation.PROCESS_ASSETS_STAGE_SUMMARIZE ||
// Fallback to DEV_TOOLING if summarize is unavailable
wp.Compilation.PROCESS_ASSETS_STAGE_DEV_TOOLING;
compilation.hooks.processAssets.tap(
{ name: 'FixSourceMapUrlPlugin', stage },
(assets: Record<string, any>) => {