Production source maps contain no `sourcesContent`
In the default configuration the generated sourcemaps for production builds with webpack 5 and ember-auto-import 2 don't seem to contain the sourcesContent key. This causes bug tracking services like Sentry to try to download the original file based on the sources content. Since the files in sources are only virtual this does not work though, which means that Sentry can't fully resolve the stack traces.
I've found a workaround by explicitly setting the devtool option of webpack (see https://github.com/rust-lang/crates.io/pull/3678):
// ember-cli-build.js
let env = EmberApp.env();
let isProd = env === 'production';
let app = new EmberApp(defaults, {
autoImport: {
webpack: {
devtool: isProd ? 'source-map' : 'eval-source-map',
},
},
},
I'm wondering if that should be made a default in ember-auto-import to avoid these kinds of issues on Sentry.
This does seem like a good default (and one that's easy to override if people disagree).