next.js
750d7ea6 - Bypass source map dev middleware for client chunks (#72581)

Commit
1 year ago
Bypass source map dev middleware for client chunks (#72581) A multi-zone Next.js app might have complex rewrites for its client assets. For these apps, resolving a source map through the `/__nextjs_source-map` dev middleware might fail because the asset might belong to a different app. Instead of trying to resolve those rewrites (i.e. using `fetch` instead of `fs`), we can just bypass the source map dev middleware for client chunks. Because we control how those source maps are generated, we can safely assume that the `sourceMappingURL` is relative to the filename, with an added `.map` extension. The browser can just request this file, and it gets served through the normal dev server, without the need to route this through the source map dev middleware. reverts #72258
Author
Parents
Loading