-
-
Notifications
You must be signed in to change notification settings - Fork 6.3k
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
Feature: Local Plugins #1841
Comments
Note that you can already have per-project UI addons with the |
Maybe we could have a similar approach, if there is a |
Someone could write a plugin that loads and runs "local plugins" and publish it on npm :-P That way we would not need to "bloat" core with it. |
Since we have it for the UI, I think it makes sense to have it for the cli-service as well. |
It's already done anyway 😹 |
If we do it, let's not create another config file though. I think providing a path in a config option in |
Oh - too late 😂 |
Holy cow, you guys are impressive - I was all ready to spend some time doing the work and creating a PR... and it's done before I brew another cup of coffee... Brainstorming a bit: are there other plugin features worth exposing locally? As @LinusBorg points out, there can be a lot of pieces and don't want to litter root too much. Thinking of potential of using the concept of generators to update filetypes - no immediate need, just thinking through impacts... |
If you need generator capabilities, it's better to do a plugin (you can even create private scopes on npm for your company). |
I changed the API to a |
Is it possible to access the GeneratorAPI through the service or would you need to invoke the plugin each time you needed generator capabilities? Something like |
What problem does this feature solve?
We have a number of complex, tightly coupled build processes which take advantage of direct access to the webpack config and starting development servers. In looking to migrate to vue-cli, we don't have the same access without being a plugin which are only loaded via package dependencies. The proposal is to specify local plugins, specific to the project.
While for our case it would be for adding adding commands, we also see the benefit in being able to provide per-project UI add-ons.
Alternatives:
package.json
- What we'll likely do w/out this feature. e.g. have a dependency of'vue-cli-plugin-OurPlugin': 'file: local/path'
. Downside is the need to ensure thatnpm -i
is called prior to any use to keep the copy in node-modules up to date.vue-cli-service inspect
- Saving webpack config to a temp file to run dev server, etc.What does the proposed API look like?
A vue.config.js field -
Implementation Notes
I can create a PR with a basic implementation, but would like to make sure it is the right approach first.
Approach: Add a function to
init
to concat local plugins here: https://github.com/vuejs/vue-cli/blob/dev/packages/%40vue/cli-service/lib/Service.js#L72The text was updated successfully, but these errors were encountered: