如何确保 reactjs 生产环境中的价值

问题描述 投票:0回答:0

为什么 .env 文件的所有内容在 view-source js 文件中仍然可读?即使该应用程序是使用“GENERATE_SOURCEMAP=false react-scripts build”构建的,或者可能有人建议将 protect.env 用于生产?

view-source browser react production

我尝试不使用“GENERATE_SOURCEMAP=false react-scripts build”,只使用“react-scripts build”它起作用了,但我的反应源文件将在浏览器的资源中

reactjs environment-variables production
© www.soinside.com 2019 - 2024. All rights reserved.