When two pages in vue use larger packages, is there any optimization?

In the

vue project, there are two pages, both of which use an editor plug-in, but the size of the editor plug-in is large, which affects the loading speed, and both pages are used, so the editor is encapsulated into a component, thinking that loading the other page only once will be faster, but this does not seem to be the case, as follows:

how should I optimize in such a situation? Encapsulated into components, introducing components into two pages seems to be similar to using plug-ins directly on the page. Solve it, thank you.

May.30,2022

Asynchronous load component
components: {
aaa: resolve= > {

require(['./aaa.vue'],resolve)

}
}


Webpack CommonsChunkPlugin


package the editor into a component according to the logic you need, such as my-editor
An and B pages lazily load the editor component

const MyEditor = () => import('@/xx/my-editor')

components: {
    MyEditor
}

on cdn


Don't underestimate webpack. As long as you are not copying and pasting the code, webpack can do a great job of packing and reloading.

MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1b3bbe6-2c2c5.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1b3bbe6-2c2c5.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?