Third-Party Libraries
Learn how to manage third-party libraries using the plugins folder.
We'll cover the following...
Avoid using third-party libraries in main.js
As mentioned previously, instead of adding all third-party libraries in the main.js
file, we put them in the plugins
folder and then import plugin files. Below are examples for Vue 2 and Vue 3.
Vue 2 and Vue 3
In Vue 2, instead of writing these lines into the main.js
file:
Press + to interact
// main.jsimport Vue from 'vue';import Vuelidate from 'vuelidate';Vue.use(Vuelidate);
Add plugins or libraries into ...