简体   繁体   中英

Remove plugins with vue-cli3

Is there a way to remove plugins and its configuration with vue-cli3 in an existing project? For example I want to replace unit test plugin Mocha with Jest. I know how to add and invoke a new plugin but I cannot find how to remove one. Is it possible with vue-cli or do I need to do it manually?

我已经问过这个问题(如何卸载插件?#2540 ),看来当前的官方建议是发出npm uninstall X

I think you can just go to your package.json and remove the entry for the plugin/package,

delete the directory of your node_modules,

and then run.

npm install

It looks like you need to do it manually, I cannot find anything in the docs or CLI help that mentions removal of plugins. It is slightly more complicated than @alexandre-canijo says though. Besides the package.json there may be some config in your project folder. Check the src/plugins folder, and main.js.

Vue CLI 帮助

The documentation

Delete the vuetify stuff[1] from your package.json and then run:

npm prune

[1] Dependency vuetify and dev dependencies vue-cli-plugin-vuetify , vuetify-loader ...

You have to do it manually. It worked for me.

In my case, I just removed the plugin ("vue-cli-plugin-quasar": "^2.0.1",) from devDependencies in package.json and ran npm install .

With the new " vue ui " option, removing installed cli-plugins is supported now.

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.

You still might get compile errors due to dead references in your sources, but those can be identified quickly with the provided log and error messages.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM