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,
insertScriptsAt: "ember-auto-import-scripts",
webpack: {
output: {
// Workaround for https://github.com/ef4/ember-auto-import/issues/519
// Upstreamed in https://github.com/ef4/ember-auto-import/pull/548
filename: `chunk.[id].[contenthash].js`,
chunkFilename: `chunk.[id].[contenthash].js`,
},
// Workarounds for https://github.com/ef4/ember-auto-import/issues/519 and https://github.com/ef4/ember-auto-import/issues/478
devtool: isProduction ? false : "source-map", // Sourcemaps contain reference to the ephemeral broccoli cache dir, which changes on every deploy
optimization: {
// Workaround to provide deterministic chunk output
// See https://github.com/ef4/ember-auto-import/issues/478#issuecomment-1000526638
moduleIds: "size",
moduleIds: "size", // Consistent module references https://github.com/ef4/ember-auto-import/issues/478#issuecomment-1000526638
},
},
},