Skip to content

Provide a vue-cli-plugin to write vue plugin out of box #2630

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
zhangbobell opened this issue Sep 27, 2018 · 2 comments
Closed

Provide a vue-cli-plugin to write vue plugin out of box #2630

zhangbobell opened this issue Sep 27, 2018 · 2 comments

Comments

@zhangbobell
Copy link

zhangbobell commented Sep 27, 2018

What problem does this feature solve?

Vue-cli 3.x is really a big progress for start a vue program instantly, but today when I want to write a vue plugin, things seems still tough. Since vue plugin is not the same with vue program, I need to config webpack, postcss, etc. The documents in vuejs.org says that how to write a plugin, but there was no docs about how to config when I am writing plugin.

I've find a vue-cli 2.0 template for this purpose: https://github.com/posva/vue-plugin-template . In Vue-cli 3.x, It seems we can provide a vue-cli-plugin to solve this problem. Could anyone give me some advice? Thank you very much!

What does the proposed API look like?

Provide a vue-cli-plugin, we could select it in the prompt when we use vue create awesome-plugin.

@LinusBorg
Copy link
Member

vue-cli 3 gives you all of the basic tools to compile a plugin as a lib, see here:

https://cli.vuejs.org/guide/build-targets.html#library

For additional boilerplate / preconfiguration, a plugin from the community can be provided - especially using rollup to compile the plugin, like the template that you linked to does, is out of scope of vue-cli itself - we focus on webpack.

@zhangbobell
Copy link
Author

I also find out that vue-cli build-target could do that, thank you for your patiently answer.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants