- Installed bit on OSX manteray (node v.16.16.0, npm 8.11.0, bit 0.0.792, bvm 0.1.4)
- I Ran
$ bit new react dot-env
$ cd dot-env
$ bit start # localhost:3000 run as expected
$ bit create react text # Creating a react compnent
$ bit create react-app host # Creating an app enviorment
- I Added the
.env
file into the root and both of the compnent directories, In case there's a dot env loader hidden on some level. - I edited the text and the host compnent to use env var which exsited in the
.env
file - I ran both
bit start
andbit run host
to check if the.env
file is somehow being loaded, It's not. - I ran
export REACT_APP_TEXT="hello" && bit start
andREACT_APP_TEXT="hello" bit start
andexport REACT_APP_TEXT="hello" && bit run host
andREACT_APP_TEXT="hello" bit run host
, and none of them seems to load the env var.
Bit to load enviorment varibles in some level.
- Compnent level env vars
- Is there a way for a compnent to load and mange it's own env vars?
- Should I Write a custom env for each compnent that I needs env vars?
- App level env vars
- Is there a way for an app to load env vars?