PERF: Only apply terser to production assets (#24699)
We funnel vendored javascript through ember-cli, but that's only used for the testem environment. Therefore, there's no need to minify it in production builds. In my tests, this reduces peak RSS of a production build from 3.53GB to 3.15GB.
This commit is contained in:
parent
c4381e0265
commit
87d850948f
|
@ -141,16 +141,20 @@ module.exports = function (defaults) {
|
|||
parsePluginClientSettings(discourseRoot, vendorJs, app),
|
||||
funnel(`${discourseRoot}/public/javascripts`, { destDir: "javascripts" }),
|
||||
generateWorkboxTree(),
|
||||
concat(adminTree, {
|
||||
inputFiles: ["**/*.js"],
|
||||
outputFile: `assets/admin.js`,
|
||||
}),
|
||||
concat(wizardTree, {
|
||||
inputFiles: ["**/*.js"],
|
||||
outputFile: `assets/wizard.js`,
|
||||
}),
|
||||
generateScriptsTree(app),
|
||||
discoursePluginsTree,
|
||||
applyTerser(
|
||||
concat(adminTree, {
|
||||
inputFiles: ["**/*.js"],
|
||||
outputFile: `assets/admin.js`,
|
||||
})
|
||||
),
|
||||
applyTerser(
|
||||
concat(wizardTree, {
|
||||
inputFiles: ["**/*.js"],
|
||||
outputFile: `assets/wizard.js`,
|
||||
})
|
||||
),
|
||||
applyTerser(generateScriptsTree(app)),
|
||||
applyTerser(discoursePluginsTree),
|
||||
testStylesheetTree,
|
||||
];
|
||||
|
||||
|
@ -261,5 +265,5 @@ module.exports = function (defaults) {
|
|||
},
|
||||
});
|
||||
|
||||
return mergeTrees([appTree, applyTerser(mergeTrees(extraPublicTrees))]);
|
||||
return mergeTrees([appTree, mergeTrees(extraPublicTrees)]);
|
||||
};
|
||||
|
|
Loading…
Reference in New Issue