1

I have added .env file in my react project that means when project uploads in the server in console source showing all components.

I got to add .env that file I worte

GENERATE_SOURCEMAP = false;

but Still it's showing all components in source can any one help me out?

Thanks adv

Manish Balodia
  • 1,863
  • 2
  • 23
  • 37
Kiran Reddy
  • 347
  • 1
  • 4
  • 14
  • You should ideally be using webpack config for source map changes. Reference - https://stackoverflow.com/questions/30870830/how-do-i-generate-sourcemaps-when-using-babel-and-webpack – tarzen chugh Jul 31 '18 at 05:27
  • @kiran, I think you should delete .map file before code push to server using script. I usually use rimraf package to remove all .map files. I used this script "postbuild": "rimraf build/**/*.map" to remove my script after code build process done. – Sagar Jul 31 '18 at 06:21
  • Note: [It is recommended to leave source maps in your builds.](https://twitter.com/dan_abramov/status/866039084573233152) – Thai Jul 31 '18 at 07:40

1 Answers1

1

Try removing the semicolon:

GENERATE_SOURCEMAP=false

Under the hood, dotenv is used to read .env files.

Thai
  • 10,746
  • 2
  • 45
  • 57