Environments in React App // src/config.js export default { s3: { BUCKET: "YOUR_S3_BUCKET_NAME", }, api: { URL: "YOUR_API_URL", }, }; export dev { s3: { BUCKET: "YOUR_S3_BUCKET_NAME", }, api: { URL: "YOUR_API_URL", }, }; export prod { s3: { BUCKET: "YOUR_S3_BUCKET_NAME", }, api: { URL: "YOUR_API_URL", }, }; const config = process.env.REACT_APP_STAGE === "production" ? prod : dev; export default { // Add common config values here MAX_ATTACHMENT_SIZE: 5000000, ...config, }; // package.json "scripts": { "start": "REACT_APP_STAGE=dev react-scripts start", "build:dev": "REACT_APP_STAGE=dev react-scripts build", "build:prod": "REACT_APP_STAGE=production npm run build", }