如何在 npm start 中禁用这些消息?

How can I disable these messages in the npm start?

它认为它只存在于新的 create-react-app 模板中,我找不到禁用它们的方法。 See screenshot

Compiled successfully!

You can now view mage-inventory in the browser.  

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

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

assets by path static/ 1.49 MiB
  asset static/js/bundle.js 1.48 MiB [emitted] (name: main) 1 related asset
  asset static/js/node_modules_web-vitals_dist_web-vitals_js.chunk.js 6.93 KiB [emitted] 1 related asset
  asset static/media/logo.6ce24c58023cc2f8fd88fe9d219db6c6.svg 2.57 KiB [emitted] (auxiliary name: main)
asset index.html 1.67 KiB [emitted]
asset asset-manifest.json 546 bytes [emitted]
cached modules 1.37 MiB (javascript) 31.3 KiB (runtime) [cached] 122 modules
webpack 5.67.0 compiled successfully in 2525 ms

我说的是webpack部分。传统的 react-scripts 启动消息后。提前谢谢你。

webpack的原因

打开node_modules/webpack/lib/WebpackOptionsApply.js

在第 375 行左右,注释这行:

new DefaultStatsPrinterPlugin().apply(compiler);

那么你可以解决这个问题