'How to Disable generating sourcemap with expo build:web

I tried with putting

GENERATE_SOURCEMAP=false 

in .env file, running command

set \"GENERATE_SOURCEMAP=false\" &&  expo build:web

and

"build": "GENERATE_SOURCEMAP=false expo build:web"

in scripts inside package.json nothing works. Devtools show my everything.

How can I protect my source from being exposed with expo:build?



Solution 1:[1]

Working with this for a while...

You can just build your web app like

GENERATE_SOURCEMAP=false expo build:web

Or edit your package.json as

"scripts": {
  "custom-web-build": "GENERATE_SOURCEMAP=false expo build:web",
  "...": "..."
}

Then

yarn custom-web-build

Note that you might have to clean your browser cookies or use a private window to see the changes.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Dharman