Modern Mode and Static Content Optimization

Learn how modern and v-once directives can reduce the code that needs to be run.

Many modern Vue applications are scaffolded using Vue-CLI, which internally uses Babel to transpile code to a format. Legacy browsers understand that. On the one hand, this is a great feature, as applications work in legacy browsers, while we developers can write modern JavaScript code and use the newest features that came out recently. On the other hand, modern browsers that are actually used by most users also receive the transpiled code to run. This means that even though modern browsers could run the ES6+ code, they still run the ES5 compliant code that might sometimes be slower than if it wasn’t transpiled. Consider the figure below.

Get hands-on with 1200+ tech skills courses.