加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 百科 > 正文

create-react-app 创建react应用环境变量(env)配置

发布时间:2020-12-15 16:17:35 所属栏目:百科 来源:网络整理
导读:参考:https://facebook.github.io/create-react-app/docs/adding-custom-environment-variables ? ? What other? .env ?files can be used? Note: this feature is?available with? [email?protected] ?and higher. .env : Default. .env.local : Local ove

参考:https://facebook.github.io/create-react-app/docs/adding-custom-environment-variables

?

?

What other?.env?files can be used?

Note: this feature is?available with?[email?protected]?and higher.

  • .env: Default.
  • .env.local: Local overrides.?This file is loaded for all environments except test.
  • .env.development,?.env.test,?.env.production: Environment-specific settings.
  • .env.development.local,?.env.test.local,?.env.production.local: Local overrides of environment-specific settings.

Files on the left have more priority than files on the right:

  • npm start:?.env.development.local,?.env.development,?.env.local,?.env
  • npm run build:?.env.production.local,?.env.production,?.env
  • npm test:?.env.test.local,?.env?(note?.env.local?is missing)

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读