Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/amitrahav/bit-load-env-reproduce
https://github.com/amitrahav/bit-load-env-reproduce
Last synced: 2 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/amitrahav/bit-load-env-reproduce
- Owner: amitrahav
- Created: 2022-08-31T14:54:11.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2022-08-31T14:56:44.000Z (over 2 years ago)
- Last Synced: 2023-03-08T09:31:39.555Z (almost 2 years ago)
- Language: TypeScript
- Size: 44.9 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Environment varibles load into bit - reproduction
## What' I did to get here?
- 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` and `bit run host` to check if the `.env` file is somehow being loaded, It's not.
- I ran `export REACT_APP_TEXT="hello" && bit start` and `REACT_APP_TEXT="hello" bit start` and `export REACT_APP_TEXT="hello" && bit run host` and `REACT_APP_TEXT="hello" bit run host`, and none of them seems to load the env var.## What's ecpected
Bit to load enviorment varibles in some level.- **Compnent level env vars**
1. Is there a way for a compnent to load and mange it's own env vars?
2. Should I Write a custom env for each compnent that I needs env vars?- **App level env vars**
1. Is there a way for an app to load env vars?