使用了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不是很了解,自己写的那些也是上网跟着别人学着写的;
可以学习下webpack的optimization优化打包配置,或者在项目中使用懒加载,react-lodaable之类的,也可以自己封装