编程语言
首页 > 编程语言> > javascript-create-react-app在生产中显示我的所有代码,如何将其隐藏?

javascript-create-react-app在生产中显示我的所有代码,如何将其隐藏?

作者:互联网

showing_all_files

在我的chrome来源标签中,我可以按确切的文件夹位置查看我的所有文件.我怎么藏起来?

这些不是我以前的项目中的问题,它是在不使用create-react-app的情况下完成的.

解决方法:

根据Issue #1632,在create-react-app中似乎是正确的行为.

Gaeron

This is expected. You can delete .map files from the build output if
you want to disable it, although you’ll get console warnings about
them missing.

There is no harm in leaving them in though in my opinion. Client code
is already available to the user’s machine so there’s no secrets in
it.

也许这是你的情况?

同样要确保您具有正确的生产版本,应将npm run build / yarn build的输出部署到您的服务器上.

标签:create-react-app,reactjs,javascript
来源: https://codeday.me/bug/20191025/1925729.html