How to know in react app on client, does current env is prod or staging?
On Backend / node js we have process.env.STAGE_NAME
But that now work on client.
This is package.json.
How I get that info on Client?
"scripts": {
"postinstall": "cd ./localDb && sls dynamodb install && cd ../",
"buildServer": "tsc -b ./server/tsconfig.json",
"buildClient": "next build ./client",
"build": "npm run buildServer && npm run buildClient",
"build:dev": "npm run buildServer && NODE_ENV=development npm run buildClient",
"dev": "node --inspect server/build/index.js",
"start": "NODE_ENV=production node server/build/index.js",
"testClient": "nyc --reporter=html --reporter=text mocha --timeout 15000 --reporter mochawesome --exit",
"testServer": "nyc --reporter=html --reporter=text mocha --timeout 15000 --reporter mochawesome --exit server/build/tests/*.js",
"lintServer": "tslint 'server/**/*.ts' --quiet --project server/tsconfig.json",
"lintClient": "eslint '**/*.{js,jsx}' --quiet",
"lint": "npm run lintClient && npm run lintServer",
"format": "prettier --write '**/*.{js,jsx,css,scss,ts}'",
"test": "npm run testClient && NODE_ENV=testing npm run testServer",
"local:db": "cd ./localDb && sls dynamodb start && dynamodb-admin"
},