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

config path cli option #3152

Open
Globegitter opened this issue Dec 18, 2018 · 4 comments
Open

config path cli option #3152

Globegitter opened this issue Dec 18, 2018 · 4 comments

Comments

@Globegitter
Copy link

What problem does this feature solve?

In some way this relates to #3150, but even more generically, sometimes the vue-cli-service cli is executed in a different working directory than the config is located, so it would be greate if it was possible to pass the custom location of the config in. This would unblock our usage with bazel.

What does the proposed API look like?

I would say vue-cli-service -c path/vue.config.js is quite common for such a flag

@LinusBorg
Copy link
Member

I'm not sure I understand this feature request, especially in terms how how it's different to #3150 and what the usecase is. Also, what's the error/issue happening right now?

@jkzing
Copy link
Member

jkzing commented Dec 20, 2018

@Globegitter , FYI you can do it by:

VUE_CLI_CONTEXT=/path/to/your/dir /path/to/your/dir/node_modules/.bin/vue-cli-service build

Emm, It's not documented though.

@DoHe
Copy link

DoHe commented Feb 28, 2019

I worked together with @Globegitter on integrating vue-cli properly with bazel, so maybe I can shed some light.
One of the core assumptions of bazel is that all commands run from the root of your monorepository and that all paths are relative to that.
So let's assume we have a project in /subdir/projectx, but bazel runs it from /, so we need a way to pick up the config at /subdir/projectx/vue.config.js.
Thanks @jkzing your hint really helped us! There is still one issue though that makes things more complicated for us then they would need to be, which is that VUE_CLI_CONTEXT has to be an absolute path. As bazel does a lot of process isolation (also using different directories for everything), it's not trivial to build absolute paths before runtime. I tried to make it accept relative paths here but have to admit that I wasn't really able to make this work.
Hope that clarifies this issue a bit.

@dubov94
Copy link

dubov94 commented Apr 21, 2020

@Globegitter @DoHe Looks like you were on the right track, and thanks @jkzing for the tip indeed! Are you still planning to push your PR forward?

FWIW I cooked up my own small wrapper for now.

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

5 participants