Compare bundle Vue2 and Vue3

Tram Ho

Hi everyone, if everyone remembers, please go to this article where I have mentioned that the bundle in vue3 has been greatly reduced

Today, we created a playground and tested it as Vue team did it ^^

Create project

Maybe you do not know, then in vue3 has released the beta version, we can run the project with vue3 already ^^

I will use vue cli v3 to create the project, along with the command

Build in the old version

I cd into the directory and yarn build to get the results when I run the old version

the following results:

Upgrade to v3

After installation is complete, I followed on https://github.com/vuejs/vue-cli-plugin-vue-next They instructed how to use vue add vue-next to upgrade the project to vue3. I will continue to run the command to get up vue3 Note: vue-next needs vue-cli version> 4.2.3, you can upgrade by npm i -g @vue/ [email protected]

It seems that after the upgrade, the project has decreased by ~ 10kb, it doesn’t look like the Vue team ad but the 10kb like the Vue team introduced is probably a more minimal version.

Thank you

Share the news now

Source : Viblo