Does vue use routing lazily to load a single file after packaging or is it very large?

when you don"t use routing lazy loading, the packaged vendor.js is a bit big. Now, after using routing lazy loading, there is a js file that prompts you to be a bit big

.

clipboard.png

:

clipboard.png

Mar.09,2021

Let's have a look at the package with a plug-in.

const BundleAnalyzer = require('webpack-bundle-analyzer')
plugins: [
  new BundleAnalyzer.BundleAnalyzerPlugin()
]

see if vendor is packed again in 0.js, if there is anything common to extract, and supplement the configuration of webpack. If it is a simple vue component, there is no way to do it without other module,.

< hr >

Webpack configuration details (including 4)-- pay attention to details


you can delete the map file when packaging, thus reducing the file size and increasing the compilation speed
/ config/index.js:productionSourceMap: true, modify to false


Delete the node_modules folder

Menu