如何使Vue应用程序摇摇欲坠以获取较小的文件?

时间:2019-08-02 11:47:08

标签: javascript vue.js webpack code-coverage tree-shaking

我使用Vue CLI 3创建了一个应用程序,我一直在观察构建过程,并警告我文件很大:

$ vue-cli-service build --modern --mode production --dest dist --target app --dashboard


-  Building legacy bundle for production...

 WARNING  Compiled with 2 warnings12:40:54 PM


 warning  

asset size limit: The following asset(s) exceed the recommended size limit (244 KiB).
This can impact web performance.
Assets: 
  js/chunk-vendors-legacy.443e5f8f.js (1.44 MiB)

 warning  

entrypoint size limit: The following entrypoint(s) combined asset size exceeds the recommended limit (244 KiB). This can impact web performance.
Entrypoints:
  app (1.46 MiB)
      js/chunk-vendors-legacy.443e5f8f.js
      js/app-legacy.4b3e4352.js

我不知道如何减小此文件的大小,它完全来自外部库:

lib sizes

我认为无法摆脱它。就在今天,我使用了chrome浏览器的“覆盖”工具,它表明该工具大部分未被使用。如何摆脱这些未使用的代码以使我的应用程序加载更快?

我已经在压缩文件,我的问题更多是关于如何使这些文件摇摇欲坠以减小文件大小。

unused code

0 个答案:

没有答案