alex
alex

Reputation: 3

how can i use .env file from my root directory?

I am working in a MERN project. I've a .env file in my root directory. I want to use some keys from that file on react app. can I use that .env file or should I make a new .env file?

Upvotes: 0

Views: 2601

Answers (1)

Yaroslav Martynov
Yaroslav Martynov

Reputation: 11

here is the library "dotenv" that makes it, also have wrap for webpack "dotenv-webpack" https://www.npmjs.com/package/dotenv

Upvotes: 1

Related Questions