简体   繁体   English

在 create-react-app 5.0.0 中禁用 Babel 编译细节

[英]Disable Babel compilation details in create-react-app 5.0.0

After updating react-scripts (Create React App) to 5.0.0, when running npm start command in terminal, it adds a bunch of compilation logs:react-scripts (Create React App)更新到 5.0.0 后,在终端运行npm start命令时,它会添加一堆编译日志:

Compiled successfully!

You can now view product-list-dashboard in the browser.

  Local:            http://localhost:3000
  On Your Network:  http://192.168.1.2:3000

Note that the development build is not optimized.
To create a production build, use npm run build.

assets by status 1.1 KiB [cached] 1 asset
assets by chunk 1.63 MiB (name: main)
  asset static/js/bundle.js 1.62 MiB [emitted] (name: main) 1 related asset
  asset main.7ab1960ed887a618980d.hot-update.js 11.3 KiB [emitted] [immutable] [hmr] (name: main) 1 related asset
assets by path *.json 431 bytes
  asset asset-manifest.json 403 bytes [emitted]
  asset main.7ab1960ed887a618980d.hot-update.json 28 bytes [emitted] [immutable] [hmr]
asset index.html 376 bytes [emitted]
Entrypoint main 1.63 MiB (1.55 MiB) = static/js/bundle.js 1.62 MiB main.7ab1960ed887a618980d.hot-update.js 11.3 KiB 3 auxiliary assets
cached modules 1.41 MiB [cached] 127 modules
runtime modules 28.2 KiB 13 modules
javascript modules 7.33 KiB
  ./src/App.js 5.58 KiB [built] [code generated]
  ./src/productList.js 1.75 KiB [built] [code generated]
webpack 5.65.0 compiled successfully in 522 ms

This behaviour is not observed in react-scripts version 4. Is there any chance to remove this information from the terminal?react-scripts版本 4 中未观察到此行为。是否有机会从终端中删除此信息?

After tinkering with with CRA settings, I found a dirty hack to make console clean again - go to node_modules/react-scripts/config/webpack.config.js and at the very end of the config object add stats: none .在修改了 CRA 设置之后,我发现了一个肮脏的 hack 来再次使控制台干净 - go 到node_modules/react-scripts/config/webpack.config.js并在配置 object 的最后添加stats: none This will bring back old-school terminal development logs without that web pack chunks rubbish这将带回没有 web 包块垃圾的老式终端开发日志

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 create-react-app / babel / 绑定 state 和函数 - create-react-app / babel / binding state and functions create-react-app 总是抛出 babel 错误 - create-react-app always throws babel error 为什么 2020 年 create-react-app 仍然包含 babel - why does create-react-app still include babel in 2020 错误:您正在运行 `create-react-app` 5.0.0,它落后于最新版本 (5.0.1) - Error: You are running `create-react-app` 5.0.0, which is behind the latest release (5.0.1) 由 create-react-app 制作的 React 页面不适用于 IE。 babel 没有用吗? - React pages that is made by create-react-app don't work on IE. Isn't babel useful? 未弹出时,create-react-app应用程序会将babel配置存储在哪里? - Where does create-react-app application store it's babel configuration when not ejected? 没有babel或任何构建工具的create-react-app工具如何工作? - How does create-react-app tool work without babel or any build tool? 使用 babel-plugin-import 导入根目录不适用于 Create-React-App - Import root directory using babel-plugin-import is not working with Create-React-App 为什么 create-react-app 中的 Babel 不能正确填充 Array.prototype.at? - why does Babel in create-react-app not polyfill Array.prototype.at properly? 使用我们从 create-react-app 获得的配置或创建我们自己的自定义 webpack 和 babel 配置并安装 react - use configuration we get from create-react-app or create our own custom webpack and babel configuration and install react
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM