I want to hide the ReactJS source code from the production. So searching after some info the web lead me to the simple solution of adding
set GENERATE_SOURCEMAP=false && react-scripts build
to the build configuration file. This for example.
But after doing that, the source code is still generated. Although the option is set. I use Windows.
Does someone have an idea why it happens?
I have tried also to do it from the win-cmd (and not from WebStorm terminal) and to use build --nomaps option. But it didn't help.



I found out the solution, and share it here for those who will encounter this issue.
Because it's on windows you have to add double quotes to this command (and not single like I did):
"build": "set \"GENERATE_SOURCEMAP=false\" && react-scripts build",
After adding it, it's working.

Credit to this article that says it on Answers 5.
Here is a similar issue .
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