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),
|
parsePluginClientSettings(discourseRoot, vendorJs, app),
|
||||||
funnel(`${discourseRoot}/public/javascripts`, { destDir: "javascripts" }),
|
funnel(`${discourseRoot}/public/javascripts`, { destDir: "javascripts" }),
|
||||||
generateWorkboxTree(),
|
generateWorkboxTree(),
|
||||||
|
applyTerser(
|
||||||
concat(adminTree, {
|
concat(adminTree, {
|
||||||
inputFiles: ["**/*.js"],
|
inputFiles: ["**/*.js"],
|
||||||
outputFile: `assets/admin.js`,
|
outputFile: `assets/admin.js`,
|
||||||
}),
|
})
|
||||||
|
),
|
||||||
|
applyTerser(
|
||||||
concat(wizardTree, {
|
concat(wizardTree, {
|
||||||
inputFiles: ["**/*.js"],
|
inputFiles: ["**/*.js"],
|
||||||
outputFile: `assets/wizard.js`,
|
outputFile: `assets/wizard.js`,
|
||||||
}),
|
})
|
||||||
generateScriptsTree(app),
|
),
|
||||||
discoursePluginsTree,
|
applyTerser(generateScriptsTree(app)),
|
||||||
|
applyTerser(discoursePluginsTree),
|
||||||
testStylesheetTree,
|
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