DEV Community

Muhammad
Muhammad

Posted on

What is INLINE_RUNTIME_CHUNK environment vairable?

When you run npm run build for a React app, this will prevent addition of inline JS into the build folder's index.html and create and attach separate JS files instead.

To use this environment variable, edit the build command as follows:

“build”: “INLINE_RUNTIME_CHUNK=false react-scripts build”,
If you rebuild your project, the generated index.html will contain no reference to inline JavaScript code.

Note:- For me I was getting error 'INLINE_RUNTIME_CHUNK' is not recognized as an internal or external command, operable program or batch file. when I added it directly in the script. I have to check the issue but I think in Windows, we cannot set env variable directly in a script and have to put it in a separate .env file.

Top comments (0)