ionic-team / trapeze

The mobile project configuration toolbox. Manage native iOS, Android, Ionic/Capacitor, React Native, and Flutter apps through a simple YAML format.
https://trapeze.dev
Other
323 stars 40 forks source link

Using .env file for environnement variables #180

Open cyrilprevot opened 1 year ago

cyrilprevot commented 1 year ago

Hi Max!

I would like to use environnement variables defined into my .env file. In my case I'm defining env variable to know which google-services.json file to copy (one for production and one for development).

Maybe I'm doing it the wrong way, idk, but I think it could be useful to have access to .env variables.

mlynch commented 1 year ago

Yea that would be useful. In the meantime you could try something like this?

export $(cat .env | xargs) && npx trapeze run...
cyrilprevot commented 1 year ago

Yes it works like this thx. I hadn't thought of doing that

gtbuchanan commented 1 month ago

For reference, Vite uses dotenv internally to handle this. I call trapeze from gulp, so I just configure dotenv in the gulp script. However, you could easily use dotenvx run npx trapeze run instead.