Modern mode of Vue CLI always builds the two bundles: modern and legacy.
$ vue-cli-service build --modern
- Building legacy bundle for production...
(snip)
DONE Compiled successfully in 42448ms
(snip)
- Building modern bundle for production...
(snip)
DONE Compiled successfully in 39693ms
(snip)
DONE Build complete. The dist directory is ready to be deployed.
(snip)
Done in 89.76s.
So it takes twice as long than I build the app without --modern
option. It's a waste of time when the app is targeted to only modern browsers.
Is there a way to prevent the Vue CLI from creating the legacy bundle?
Try using Ctrl-C instead. It allows the application to gracefully shut down.
Vue CLI is now in maintenance mode. For new projects, please use create-vue to scaffold Vite-based projects. create-vue supports both Vue 2 and Vue 3. Also refer to the Vue 3 Tooling Guide for the latest recommendations.
Yes. You can add Vue functionality to existing project without Vue CLI. Preferably a project using Webpack as bundler...then it is pretty simple. You need 3 packages: vue@next, @vue/compiler-sfc and vue-loader and add some rule configuration in your webpack.
vue-cli-service lintLints and fixes files. If no specific files are given, it lints all files in src and tests , as well as all JavaScript files in the root directory (these are most often config files such as babel. config. js or .
You don't need to use --modern
flag.
Instead, just adjust .browserslistrc
like as follows:
last 2 years
Vue CLI's "Modern" mode stands for the mode which builds two bundles -- legacy and modern --, but it does not represent the appropriate way to make your Vue app code "modern". If you want only the modern output, just adjust what browsers are targeted.
See also this comment on the vue-cli issue.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With