Is there a way to remove sourcemap line in built assets?
See original GitHub issueSimilar question here: https://github.com/facebookincubator/create-react-app/issues/1004.
Is a nice way to remove the sourcemap line from the .js
and .css
files?
I’m tossing up between looking for the sourcemap pattern (//# sourcemap
etc) and removing the match or ejecting to remove it from the webpack config, though that seems drastic for such a minor change.
Issue Analytics
- State:
- Created 7 years ago
- Reactions:1
- Comments:23 (8 by maintainers)
Top Results From Across the Web
How to disable source maps for React JS Application
This way, it will auto delete map files during build generation. ... Go to /config/webpack.config.js directory and change the following line ...
Read more >Source Maps - Parcel
If you're writing a custom packager, it's your responsibility to concatenate the source maps of all the assets while packaging. This is done...
Read more >Source maps and how it works - Ehsan Gazar
Using Webpack, specifying devtool: "source-map" in your Webpack config will enable source maps, and Webpack will output a sourceMappingURL ...
Read more >Should I Use Source Maps in Production? | CSS-Tricks
It's a valid question. A "source map" is a special file that connects a minified/uglified version of an asset (CSS or JavaScript) to...
Read more >SourceMapDevToolPlugin - webpack
If you want to use a custom configuration for this plugin in development mode, make sure to disable the default one. I.e. set...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
GENERATE_SOURCEMAP=false react-scripts build
doesn’t work?@tbillington @gaearon you can add a postbuild or (pre in case of gh-pages ,etc) script to your package.json and use rimraf to remove the files.
The
//# sourcemap
line will give warning source map not found on dev console though. Removing this would be little troublesome but can be totally done using postbuild script. you can create a script using decomment and run it as part of postbuild or (prepublish, etc)