0

I want to disable the source maps so that my code will not appear in the deployment link source. As you will see on the screenshot I changed the build and I created .env file but still it does not work and the code is still visible. Also the .env file won't be committed and it says Untracked Files. ScreenShot

2
  • Delete your build folder entirely, and then try to run the build again. Are the source maps still there? Commented May 19, 2019 at 11:51
  • I did that and it didn't work Commented May 19, 2019 at 16:21

2 Answers 2

1

Try removing map files after a build.

"scripts": {    
    ...
    "build": "react-scripts build",
    "postbuild": "rimraf build/**/*.map"
    ...
  }
Sign up to request clarification or add additional context in comments.

2 Comments

badly, it makes a recursion call
try it adding postbuild
0

I replace the current "build" with "build": "react-scripts build && rm build/static/js/*.map && rm build/static/css/*.map" and it works. I twill remove the js and css from the sources.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.