vuejs / vue-cli

🛠️ webpack-based tooling for Vue.js Development
https://cli.vuejs.org/
MIT License
29.75k stars 6.32k forks source link

resolve-from cli option #3150

Open Globegitter opened 5 years ago

Globegitter commented 5 years ago

What problem does this feature solve?

We are using bazel (https://bazel.build/) as a build system in a monorepo setup. Bazel usually executes in the root of the monorepo but we still have a package.json per project, so it might be in app1/package.json as well as app2/package.json. Adding the resolveFrom in the root package.json does not work for this use-case as depending on which project I point I need to point the cli at the different directory. So if I could just specify vue-cli-service --resolve-from appX that would solve my issue as I can change that per invocation and I can even tell bazel to add different cli flags when running it for different aps..

What does the proposed API look like?

It would do the same as the existing resolveFrom attribute just allowing to set this via a cli arg. Alternatively setting this via en environment variable could also solve our issue, but in not such a nice fashion.

LinusBorg commented 5 years ago

Adding the resolveFrom

What's that?

Globegitter commented 5 years ago

@LinusBorg it is mentioned in the documentation here: https://github.com/vuejs/vue-cli/blob/bef5942b218b848c1ddf25106832851f206591b2/docs/guide/plugins-and-presets.md

LinusBorg commented 5 years ago

Oh, right, didn'T make the connection, assumed it was related to Bazel (which I heard about today for the first time!)

Globegitter commented 5 years ago

Just to update, having https://github.com/vuejs/vue-cli/issues/3685 would be the preferable feature as it completely takes away the need of the package.json.