Copy polyfills source maps
See original GitHub issueFeature request
I would like to request a feature to copy source maps from polyfills to next build. Currently, the source maps are skipped but js file still contains a reference to it.
This request is very related to https://github.com/zeit/next.js/issues/7579 but I decided to report it separately since it probably requires a different bunch of work. Feel free to close if you find it duplicate.
Is your feature request related to a problem? Please describe.
We use source map loader in our app which allows us to include third-party source maps in our build. It is extremely helpful especially in conjunction with Sentry. It helps us track down bugs easily and eventually if it is not a bug on our side then report it to correct package maintainers.
I prepared MWE for you when you run the app and open chrome console you will see something like:
Can't resolve './unfetch.js.map' in '/mnt/c/Users/joozty/Documents/next-source-maps/node_modules/next/dist/build/polyfills'
it happens because unfetch.js file copied here contains a reference to a source map which is not copied. (It’s probably the same for other polyfills too.)
Describe the solution you’d like
I would like to have these source maps included. It’s not a big deal and this warning can be ignored but as I mentioned earlier it’s a nice feature for having bug free JS ecosystem. 😃
Issue Analytics
- State:
- Created 3 years ago
- Comments:6 (3 by maintainers)
Top GitHub Comments
For anybody affected by this issue. You may disable source map preloader for these specific modules/files like this:
@timneutkens I would love to take this one, one approach could be copying the
.map
file onto the build, what do you think?