Como definir variáveis de compilação .env ao executar o script de compilação create-react-app?

Estou usando a seguinte variável de ambiente no meu create-react-app:

console.log(process.env.REACT_APP_API_URL) // http://localhost:5555

Funciona quando corronpm start lendo um.env Arquivo:

REACT_APP_API_URL=http://localhost:5555

Como defino um valor diferente comohttp://localhost:1234 ao executar umnpm run build?

Este é meupackage.json Arquivo:

{
  "name": "webapp",
  "version": "0.1.0",
  "private": true,
  "devDependencies": {
    "react-scripts": "0.9.0"
  },
  "dependencies": {
    "react": "^15.4.2",
    "react-dom": "^15.4.2"
  },
  "scripts": {
    "start": "react-scripts start",
    "build": "react-scripts build",
    "test": "react-scripts test --env=jsdom",
    "eject": "react-scripts eject"
  }
}

questionAnswers(2)

yourAnswerToTheQuestion