Nginx exposes source maps in production
See original GitHub issueINFO: solution from #1127 : npm run build angular configuration production adds source maps (*.js.map) to for PWA browser and SSR.
Actual Behavior
If environment variable SOURCE_MAPS has one of the values 1
, on
, true
or yes
, then :
- PWA exposes source maps in browser
- PWA SSR exposes source maps to web clients, i.e. search engine crawler / robot (SEO) else
- PWA exposes source maps in browser
- PWA SSR exposes NO source maps
Expected Behavior
If environment variable SOURCE_MAPS has one of the values 1
, on
, true
or yes
, then :
- PWA exposes source maps in browser
- PWA SSR exposes source maps to web clients, i.e. search engine crawler / robot (SEO) else
- PWA exposes NO source maps in browser
- PWA SSR exposes NO source maps
Steps to Reproduce the Bug
Steps to reproduce the behavior:
- Go to PWA Home Page
- Open Web Browser Dev Tools > Sources
- Search for typescript file api-token.ts. The search returns a search hit unexpectedly.
Environment Details
-
Desktop: *
- OS: Windows 10
- Browser: chrome / brave
- Project Code Version : gib branch master on 31 May 2022
Issue Analytics
- State:
- Created a year ago
- Comments:10 (3 by maintainers)
Top Results From Across the Web
Using sourcemaps on production without exposing the source ...
Sourcemaps can be easily configured with webpack, all you need to do is to set devTool property in your webpack.config.js to either 'sourcemap' ......
Read more >Serving source maps in production | The Making of Close
Since we already have an Nginx container with source maps and production build, we can use that to serve source maps only for...
Read more >tcp - Slow performance of Nginx when using Source Maps in ...
I have a problem with Nginx and source maps. I wanted to use them in production for debugging. They are not actually downloaded...
Read more >Should I Use Source Maps in Production? | CSS-Tricks
A “source map” is a special file that connects a minified/uglified version of an asset (CSS or JavaScript) to the original authored version....
Read more >Is there a way to remove sourcemap line in built assets? #1341
Is a nice way to remove the sourcemap line from the .js and .css ... Production deploy - How to remove/disable webpack source-map...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@shauke @dhhyi I confirm your test results. The bug is invalid and I close it.
Tested with
docker-compose.yml
configuration:that resulted in
I would say the exposing and not exposing of the source maps files works as expected.