mirror of
https://github.com/discourse/discourse.git
synced 2025-02-25 18:55:32 -06:00
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:
parent
0a02a5d05a
commit
20dc27232e
@ -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",
|
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
Loading…
Reference in New Issue
Block a user