Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Using Vue CLI - How do I update, remove and view all available plugins

I am new to Vue.js and it looks like Vue CLI is the way to go for rapid development. So I installed it and created an app which is running nicely.

I added the Vuetify.js plugin with vue add vuetify and will also add the vuex and vue-router plugins. But I was wondering about:

  1. Is there a command to list all available Vue CLI plugins? I am aware that one can manually select some during the creation of an app.
  2. How do I update a plugin such as Vuetify.js?
  3. How do I remove a plugin from my app?

Thanks in advance!

like image 599
Ewald Stieger Avatar asked Jul 10 '18 13:07

Ewald Stieger


People also ask

How do I remove plugins from vue command line?

Under "Dependencies" (second tab on the left of vue ui) you'll find all plugins listed. And on the right of each plugin there is a little trash icon, which removes the respective plugin.

How do I use plugins in vue CLI?

If a plugin is already installed, you can skip the installation and only invoke its generator with the vue invoke command. The command takes the same arguments as vue add . If for some reason your plugins are listed in a package. json file other than the one located in your project, you can set the vuePlugins.

How do I check my vue-CLI-service?

You can verify that it is properly installed by simply running vue , which should present you with a help message listing all available commands.


2 Answers

  1. You can use vue inspect --plugins
  2. Remove it and the add it again.
  3. I've looked for it, and this is also ridiculous, It seems you have to do it manually, go to the src/plugins directory, and read what it's related to the plugin and remove. Maybe you could open an issue on the github repository?
like image 104
Rainb Avatar answered Oct 27 '22 03:10

Rainb


Q1. Is there a command to list all available Vue CLI plugins?

You can use vue ui command to open vue ui in browser. There import your project, than click on your added project. On left hand side you'll see "Plugins" menu (along with other useful menus). Here you can see list of all the plugins, add new plugin, update existing plugins.

Another way is to check the package.json file. Check for any dependancy with vue-cli-plugin-* or @vue/cli-plugin-*. These are your vue plugins, because all vue cli plugin must start with cli-plugin.

Q2. How do I update a plugin such as Vuetify.js?

In the vue ui, from plugins menu you can update your plugins. If there is a newer version of any plugin, an update icon will appear on the right hand side of that plugin. Just click it and it will take care rest of the update. I've searched but couldn't find any suitable command for this. So if you want to use the command prompt, npm update will do the trick.

Q3. How do I remove a plugin from my app?

Again there is no vue command to do this. We have to fall back to npm and use npm uninstall instead. This will remove the plugin from your project, however vue cli plugins can modify your project. These changes you have to remove manually.

like image 22
Mishel Tanvir Habib Avatar answered Oct 27 '22 03:10

Mishel Tanvir Habib