PERF: Disable auto-import sourcemaps in production (#18923)

Even with the `chunkFilename` change, the sourcemaps are non-deterministic because they include references to the broccoli cache directory which has a different name for each build. This commit disables auto-import sourcemaps in production to improve caching performance.

Followup to 3673d3359c
This commit is contained in:
David Taylor 2022-11-07 22:28:55 +00:00 committed by GitHub
parent 0a02a5d05a
commit 20dc27232e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 9 deletions

View File

@ -58,16 +58,10 @@ module.exports = function (defaults) {
forbidEval: true, forbidEval: true,
insertScriptsAt: "ember-auto-import-scripts", insertScriptsAt: "ember-auto-import-scripts",
webpack: { webpack: {
output: { // Workarounds for https://github.com/ef4/ember-auto-import/issues/519 and https://github.com/ef4/ember-auto-import/issues/478
// Workaround for https://github.com/ef4/ember-auto-import/issues/519 devtool: isProduction ? false : "source-map", // Sourcemaps contain reference to the ephemeral broccoli cache dir, which changes on every deploy
// Upstreamed in https://github.com/ef4/ember-auto-import/pull/548
filename: `chunk.[id].[contenthash].js`,
chunkFilename: `chunk.[id].[contenthash].js`,
},
optimization: { optimization: {
// Workaround to provide deterministic chunk output moduleIds: "size", // Consistent module references https://github.com/ef4/ember-auto-import/issues/478#issuecomment-1000526638
// See https://github.com/ef4/ember-auto-import/issues/478#issuecomment-1000526638
moduleIds: "size",
}, },
}, },
}, },