nuxt/cli

[Feature] Consider adding `--dotenv` to `nuxi prepare`

Closed this issue · 0 comments

I am trying to setup a monorepo and stumble on a few things which makes it hard to use env variables with Nuxt monorepos, where every app of the monorepo needs access to these.

Current issue

I've tried using the --dotenv on every script inside every app, to point to the main .env file which sits in the root of the monorepo. This does not fully work though, since some of the steps triggered by nuxi prepare require env variables (in my case graphql type generation). And since the prepare command does not have the --dotenv option like the others, I am not able to use this feature.

Alternatives

I've also tried other option such as the dotenv-cli, which comes with it's own problems though, especially regarding to Vercel deployment and package installations.