编译警告?
来源:16-3 Vue CLI多环境编译

慕神4535282
2020-10-30
老师,下午好,请教一个问题,编译 prod 时,出现3个警告:
WARNING Compiled with 3 warnings
warning 1
asset size limit: The following asset(s) exceed the recommended size limit (244 KiB).
This can impact web performance.
Assets:
ace/assets/css/ace.min.css (388 KiB)
ace/assets/font-awesome/4.5.0/fonts/fontawesome-webfont.svg (357 KiB)
ace/assets/js/jquery.jqGrid.min.js (304 KiB)
static/image/小节视频/test1.mp4 (334 KiB)
static/image/讲师头像/头像4.jpg (491 KiB)
static/image/讲师头像/头像6.jpg (457 KiB)
static/image/小节视频/test.mp4 (527 KiB)
static/image/讲师头像/头像5.jpg (611 KiB)
warning 2
entrypoint size limit: The following entrypoint(s) combined asset size exceeds the recommended limit (244 KiB). This can impact web performance.
Entrypoints:
app (277 KiB)
js/chunk-vendors.7505cb0e.js
css/app.6424bcc2.css
js/app.1362cb8d.js
warning 3
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/
这些警告要怎么消除呢? 谢谢老师解答!!!
1回答
-
这是说你打包太大了,一般不用管警告。
可以学习一下vue的懒加载,这样初始只会打依赖的,访问哪个页面再去加载那个页面的资源。
一种是初始的时候就全部加载,只需要跟服务器交互一次。一种是初始加载少,用到哪个再去服务器加载,需要交互多次
00
相似问题