Embed sourcesContent in source maps #697
Open
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR changes how source maps and original sources are emitted.
"sources": ["application.source.js"]
.public/assets/application.source.js
will be copied fromapp/assets/application.js
."sources" ["application.js"], "sourcesContent": ["<the verbatim copy of app/assets/application.js>"]
..source
extension because there's no concern about file name conflicts.There are two main purposes of source maps: for using in browsers' developer tools, and for error reporting services, like New Relic or Sentry. For the latter purpose, we usually upload source maps directly to the service and delete them before uploading to e.g. S3. Without
sourcesContent
bundled in the source maps, we won't be able to provide sufficient information to the error reporting service. Moreover, we need to removeapplication.source.js
etc. as well to avoid accidental source code leakage.Fixes #580.
Question: should we instead provide the
embed_source_in_source_maps
flag and let users decide the way sources are provided?