使用了antd之后,npm run dev虽然可以使用,但是会有警报,大概的意思是跟文件大小有关

使用了antd之后,npm run dev虽然可以使用,但是会有警报,大概的意思是跟文件大小有关

webpack里面是这样配置的

{
    test: /\.css$/,
    use: ['style-loader', 'css-loader'],
},

警告内容:

WARNING in asset size limit: The following asset(s) exceed the recommended size limit (244 KiB).
This can impact web performance.
Assets:
  app/main_2f8453eb.js (739 KiB)

WARNING in entrypoint size limit: The following entrypoint(s) combined asset size exceeds the recommended limit (244 KiB). This can impact web performance.
Entrypoints:
  main (739 KiB)
      app/main_2f8453eb.js


WARNING in webpack performance recommendations: 
You can limit the size of your bundles by using import() or require.ensure to lazy load some parts of your application.
For more info visit https://webpack.js.org/guides/code-splitting/

对webpack不是很了解,自己写的那些也是上网跟着别人学着写的;

阅读 2.8k
1 个回答

可以学习下webpack的optimization优化打包配置,或者在项目中使用懒加载,react-lodaable之类的,也可以自己封装

撰写回答
你尚未登录,登录后可以
  • 和开发者交流问题的细节
  • 关注并接收问题和回答的更新提醒
  • 参与内容的编辑和改进,让解决方法与时俱进