📜  如何在 react 中导入 dotenv - Javascript 代码示例

📅  最后修改于: 2022-03-11 15:01:26.832000             🧑  作者: Mango

代码示例1
//create .env file and use prefix "REACT_APP_" infront of variable name
//for example
REACT_APP_TOKEN=abcdefghijklmnopqrstuvwxyz

// inside react file simple call it by
process.env.REACT_APP_TOKEN

//if your react server was running before creation of .env and restart it.