How to disable inline-script and source-map in React JS so that the source code for the app will be obfuscated?
meda Changed status to publish 16/07/2022
@mesihg,
To disable inline-script and source-map in react js, you may have a couple of ways to do so.
- build your code with with the following script.
123
"scripts"
: {
"build"
:
"INLINE_RUNTIME_CHUNK=false && GENERATE_SOURCEMAP=false && react-scripts build"
}
- create .env file and add the following lines. then build the project.
12
INLINE_RUNTIME_CHUNK=
false
GENERATE_SOURCEMAP =
false
the_reactor Answered question 18/02/2022