Skip to content
GitLab
Projects Groups Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
  • C create-react-app
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 1,547
    • Issues 1,547
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 417
    • Merge requests 417
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Packages and registries
    • Packages and registries
    • Package Registry
    • Infrastructure Registry
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • Meta
  • create-react-app
  • Issues
  • #6995
Closed
Open
Issue created May 06, 2019 by Administrator@rootContributor

docs: deployment -> custom env variables, env-cmd example is not working

Created by: VMois

Is this a bug report?

Incorrect information in docs -> Deployment.

Steps to Reproduce

  1. Go to https://facebook.github.io/create-react-app/docs/deployment#customizing-environment-variables-for-arbitrary-build-environments
  2. Follow the instruction and try to run env-cmd as suggested in docs. You will receive different error like FileNotFound etc. (I am using env-cmd version 9.0.1)

Expected Behavior

After some time, I found a solution. Working example:

"scripts": {
    "build:local": "env-cmd -f ./.env.production.local npm run build",
    "build:production": "env-cmd -f ./.env.production npm run build"
  }

Actual Behavior

In docs you can find something like this:

{
  "scripts": {
    "build:staging": "env-cmd .env.staging npm run build"
  }
}
Assignee
Assign to
Time tracking