question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Always output source maps

See original GitHub issue

Describe the issue

Currently, source maps are only written in development (using gulp-if and !PRODUCTION as condition). This makes it harder to inspect the code of the live site in the browser’s DevTools and as far as I see doesn’t really have any advantages, the code is open source anyway.

Suggested change

Shipping source maps makes it easier to inspect and debug code on the live site and also is nice for beginners who might want to take a look at the website’s code to discover how something was implemented. 😃 So I suggest removing the guarding calls to $.if() that currently wrap $.sourcemaps.write() as well as the condition for the devtool webpack config.

I’d be happy to submit a PR if you agree. 😃


Internal Tracking ID: EXPOSUREAPP-12958

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:2
  • Comments:6 (6 by maintainers)

github_iconTop GitHub Comments

2reactions
dsarkarcommented, May 3, 2022

@jonaskuske Thanks for your suggestion. Now implemented. Best wishes, DS


Corona-Warn-App Open Source Team

1reaction
svengabrcommented, Apr 28, 2022

@MikeMcC399

In theory, you should never have to debug in production. But in reality, it happens all the time since most users don’t run our project locally anyways.

There’s no security risk to shipping source maps to production since the code is open-source as @jonaskuske mentioned already. If a person thinks that code obfuscation is a reliable form of security then they already have a problem.

So from my point of view, we are good to proceed to bring the source maps to production.

It will add some megabytes to the package but the maps will only be downloaded with dev tools opened.

Read more comments on GitHub >

github_iconTop Results From Across the Web

There is no way to serve source map files separately #783
But webpack always places source map files within output dir and uses relative paths as urls for them. There is no way to...
Read more >
Should I Use Source Maps in Production?
You should always have map files, and especially if you're working in production. But there is a difference between having map files and...
Read more >
4 Reasons Why Your Source Maps are Broken
4 Reasons Why Your Source Maps are Broken · Missing or incorrect source map directive · Missing original source files · Bad source...
Read more >
What are Javascript Source Maps?
It's generally a good practice to minify and combine your assets (Javascript & CSS) when deploying to production. · Source maps create a...
Read more >
Improving Development with Source Maps for Debugging
The DevTools of all modern browsers offer built-in source maps. These source maps enable DevTools functionality like debugging with breakpoints ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found