mirror of
https://github.com/discourse/discourse.git
synced 2025-01-18 12:42:46 +08:00
DEV: refactor ember-cli-build (#22694)
pass the extra public trees to `app.toTree()` to match:
0e00f2bf15/packages/test-setup/src/index.ts (L24-L27)
The ember-cli-terser addon now takes care of minifying all additional trees, so we can remove our custom terser-related logic
This commit is contained in:
parent
132bd375f6
commit
e1d27400f5
|
@ -188,38 +188,28 @@ module.exports = function (defaults) {
|
|||
.findAddonByName("pretty-text")
|
||||
.treeForMarkdownItBundle();
|
||||
|
||||
const terserPlugin = app.project.findAddonByName("ember-cli-terser");
|
||||
const applyTerser = (tree) => terserPlugin.postprocessTree("all", tree);
|
||||
|
||||
return mergeTrees([
|
||||
return app.toTree([
|
||||
createI18nTree(discourseRoot, vendorJs),
|
||||
parsePluginClientSettings(discourseRoot, vendorJs, app),
|
||||
app.toTree(),
|
||||
funnel(`${discourseRoot}/public/javascripts`, { destDir: "javascripts" }),
|
||||
funnel(`${vendorJs}/highlightjs`, {
|
||||
files: ["highlight-test-bundle.min.js"],
|
||||
destDir: "assets/highlightjs",
|
||||
}),
|
||||
generateWorkboxTree(),
|
||||
applyTerser(
|
||||
concat(adminTree, {
|
||||
inputFiles: ["**/*.js"],
|
||||
outputFile: `assets/admin.js`,
|
||||
})
|
||||
),
|
||||
applyTerser(
|
||||
concat(wizardTree, {
|
||||
inputFiles: ["**/*.js"],
|
||||
outputFile: `assets/wizard.js`,
|
||||
})
|
||||
),
|
||||
applyTerser(
|
||||
concat(markdownItBundleTree, {
|
||||
inputFiles: ["**/*.js"],
|
||||
outputFile: `assets/markdown-it-bundle.js`,
|
||||
})
|
||||
),
|
||||
concat(adminTree, {
|
||||
inputFiles: ["**/*.js"],
|
||||
outputFile: `assets/admin.js`,
|
||||
}),
|
||||
concat(wizardTree, {
|
||||
inputFiles: ["**/*.js"],
|
||||
outputFile: `assets/wizard.js`,
|
||||
}),
|
||||
concat(markdownItBundleTree, {
|
||||
inputFiles: ["**/*.js"],
|
||||
outputFile: `assets/markdown-it-bundle.js`,
|
||||
}),
|
||||
generateScriptsTree(app),
|
||||
applyTerser(discoursePluginsTree),
|
||||
discoursePluginsTree,
|
||||
]);
|
||||
};
|
||||
|
|
Loading…
Reference in New Issue
Block a user