修改script命令
–inspect-brk是打开node的debugger模式
"scripts": {
"start:dev": "node -r dotenv/config scripts/ dotenv_config_path=.",
"build:one": "node --inspect-brk -r dotenv/config scripts/ dotenv_config_path=.",
"test": "node scripts/"
},
.和.在项目根目录下
内容.
REACT_APP_key=dev
内容.
REACT_APP_key=dev
自己测试就能看到,自己设置的环境变量了
let a=.REACT_APP_key
(a,“.REACT_APP_key”);