Almog
Almog

Reputation: 2837

React build with env file

I'm trying to build my react app but set a specific env file, right now it's going to the .production.env which is auto set on the build. I have tried the following but it's not working

"build:portal-customer-staging": "run-s cp:portal-customer --env=.env.development react:build ",  

And my build

"build": "run-s build:_error exit:1",
"react:build": "react-scripts build",

Start

"react:start": "react-scripts start",
"start": "run-s start:_error exit:1",

Upvotes: 0

Views: 185

Answers (1)

Almog
Almog

Reputation: 2837

I was able to get this working using https://github.com/toddbluhm/env-cmd

Upvotes: 1

Related Questions