How does vue package third-party dependent libraries separately from each other?

because the project depends on too many library components, if you don"t use cdn to package, js will have 6MB, while cdn is unreliable, sometimes fast and sometimes slow, can you package each dependent library separately and try not to make a single file too large?

I have tried to put the dependency in the static folder and then reference it in index.html. Although the goal can be achieved, it is too troublesome to maintain manually, and the library referenced through index.html has no code hint in idea, which is very embarrassing

Mar.18,2021

this has nothing to do with vue. Two methods are recommended:
1, front-end solution: require.ensure ()
2, server solution: gzip compression

Menu