2

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.

Config-file.

npm-logs

maps-files-still-exist

lingar
  • 477
  • 1
  • 7
  • 25

1 Answers1

0

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.

Map now not exist

Credit to this article that says it on Answers 5.

Here is a similar issue .

General Grievance
  • 4,555
  • 31
  • 31
  • 45
lingar
  • 477
  • 1
  • 7
  • 25