Vue-cli3 runtime app.js is as high as 15MB, while compilation is only 29kb. How to solve this problem?

 "scripts": {
    "serve": "vue-cli-service serve",
    "build": "vue-cli-service build"
  },

execute: npm run serve
clipboard.png

:npm run build
clipboard.png

Mar.14,2022

this is a normal phenomenon.

yarn run serve is the development environment, so all kinds of packages are not optimized. All content is in app.js
yarn run build is a production package, and various optimizations are enabled, especially when tree shaking, splits dependencies into different js, so the size of app.js will be much smaller

.
Menu