Add support for the "external" source map type (webpack's "hidden-source-map"). #7352
rossipedia
started this conversation in
Proposals
Replies: 1 comment
-
I think allowing this to be configured in the /** @type {import('@remix-run/dev').AppConfig} */
export default {
sourcemap: "external" // or "internal" or false which can be the default
} |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Often times, company policy prohibits exposing un-minified source code to the public, for various reasons.
In these instances, making source maps publicly accessible isn't feasible. Instead, they will often be uploaded to a service such as Sentry or Bugsnag, so that when errors are reported we can view unminified stack traces and get the original names/context back.
Currently, Remix's
--sourcemap
flag builds what Esbuild refers to as a "linked" source map.The generated bundle includes a comment at the end of the form:
//# sourceMappingURL=...
which specifies the location of the source map, with the expectation that it will be uploaded to that URL, often right next to the JS bundle itself.Since the
*.map
files can't be uploaded in our case, we end up with a spam of broken links in the browser console as it tries to find the source map for Remix's browser bundles.Proposal: Add an option for "external" sourcemaps.
I realize the Remix team doesn't want to expose Esbuild internals externally, but the concept isn't specific to Esbuild. Webpack's equivalent is the
hidden-source-map
option fordevtool
:POC implementation:
Beta Was this translation helpful? Give feedback.
All reactions