缩小 React 构建文件以使其难以阅读

问题描述

我已经使用 create-react-app 和 make build 创建了 React 应用程序。我看到一些 js 文件被缩小了,但是当我在 Chrome Dev Tools 中检查它们时,它们在“美化”模式“{}”(相同的变量名称等)下看起来几乎没有改变。地图文件被移除。

是否有一种简单的方法可以缩短变量名称,例如 a,b,c,d,e,f... 等,例如“p,a,k,r”工具所做的?

谢谢!

这是构建过程的转储

d:\folder\jvgs4>npm run build

> [email protected] build d:\folder\jvgs4
> react-scripts build

Creating an optimized production build...
browserslist: caniuse-lite is outdated. Please run next command `npm update`
Compiled with warnings.

...some warning messages

Search for the keywords to learn more about each warning.
To ignore,add // eslint-disable-next-line to the line before.

File sizes after gzip:

  89.42 KB (-46 B)  build\static\js\2.594b29a3.chunk.js
  54.46 KB (-42 B)  build\static\js\3.c2f4981f.chunk.js
  22.89 KB (-44 B)  build\static\js\4.e7fba51b.chunk.js
  3.31 KB (-41 B)   build\static\js\main.89abc980.chunk.js
  1.17 KB (-49 B)   build\static\css\main.70a8ce85.chunk.css
  1.14 KB (-42 B)   build\static\js\runtime-main.0bbc6d46.js

The project was built assuming it is hosted at https://api.zxlab.org/.
You can control this with the homepage field in your package.json.

The build folder is ready to be deployed.
You may serve it with a static server:

  npm install -g serve
  serve -s build

Find out more about deployment here:

......

这是我的js代码截图

https://e-wm.org/i/E20210408-002337-001.png

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)