You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I noticed that .env files are correctly read in dev mode in the main, but not in production (using yarn try for ex). Any idea on how I could make this work?
Thanks a lot 🙏
The text was updated successfully, but these errors were encountered:
In the main I look through process.env for variables.
I looked at the output of build --verbose and I do see the variables from my .env files being passed through the define prop to esbuild.
After further investigation, I realized that my logic for getting an env variable from the main was actually located under another folder shared/ where I call process.env etc.. If I log the content of process.env from a file within shared/ I do not see the variables coming from my dotenv files. But when I do this from a file in the main/ folder they are there...
I can work around this short term but it would be nice to understand what's going on..
Yeah, if you don't use the variables directly, but rather dynamically or via destructuring it won't work (evanw/esbuild#438 (comment)). I might look later around for newer techniques to handle this better.
Hey 👋 ! Great work, thank you for this project!
I noticed that .env files are correctly read in dev mode in the main, but not in production (using
yarn try
for ex). Any idea on how I could make this work?Thanks a lot 🙏
The text was updated successfully, but these errors were encountered: