I deploy a node.js app on pm2 server which serves my client code with Nginx. My client source code is bundled with Webpack. It is supposed to be minified and obfuscated. But when I run my app on client side and I open the console log "source" tab I can see both the obfuscated source code and the webpack file structure which is located under a "top://Webpack" directory.
I don't want to show my code structure to the client. How can I get rid of that webpack file structure on the browser?
This original file structure is provided by sourcemaps. Which is great because allows you to trace back errors in production code.
You have the following options here
devtool: false
Docs.*.map
files by removing them or by configuring nginx not to serve those files.You could read a discussion why this is not that great idea here
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With