Skip to content
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

Option to not install vue as a dependency #5244

Closed
petterw03 opened this issue Mar 5, 2020 · 3 comments
Closed

Option to not install vue as a dependency #5244

petterw03 opened this issue Mar 5, 2020 · 3 comments

Comments

@petterw03
Copy link

What problem does this feature solve?

I really like vue-cli for its ease of use while still being highly customizable. My team has integrated vue-cli smoothly into our workflow using a custom plugin. This process is working so great that we have started experimenting with using it for non-Vue projects as well. However, since Vue is always automatically installed as a dependency, we have to remove it manually after install, which is time-consuming.

In short, we would like a command-line option to not automatically install vue, to be able to use vue-cli for non-vue projects.

What does the proposed API look like?

vue create would get a new option that could be called --no-vue. If present, cli-service generator would skip adding vue and vue-template-compiler as dependencies.

I am willing to help implement this feature if it is found to be within the scope of this project.

@LinusBorg
Copy link
Member

I'm not sure that we should go down this road. This is explicitly a Vue project. Apart from adding vue as a dependency to package.json, we install vue-loader and configure webpack to deal with.vue files. we add vue-spefic config to eslint and other tools etc.

While I can understand that you might be able to live with those points as they don't influence the code output, once we signal that we provide options to use Vue CLI outside of Vue projects, these points will come up rather sooner than later.

So on principal, I think that we should not burden the project with supporting various usecases outside of the Vue ecosystem that way,

And at the same time, deleteing one line from package.json and running yarn again takes aproximately 20 seconds max, so unless you created dozens of projects per day, I'm not too sure you can call this process "time-consuming".

@sodatea
Copy link
Member

sodatea commented Mar 5, 2020

A tip:
With this PR #5149, in a preset/plugin generator, you can pass { prune: true } to api.extendPackage to remove existing dependencies.
Here's an example: https://github.com/vuejs/vue-cli-plugin-vue-next/pull/9/files

@petterw03
Copy link
Author

Thanks for the comments!

LinusBorg had some good points and I understand that this feature might be out of scope. But at the same time as more use cases could be a burden, it could attract more contributors to a very functional tool. This would of course be a much greater discussion, I realize now.

The option that sodatea pointed me to does seem to help a bit on the way! Thanks!

@sodatea sodatea closed this as completed May 27, 2020
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

3 participants