mirror of
https://github.com/discourse/discourse.git
synced 2025-02-25 18:55:32 -06: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")
|
.findAddonByName("pretty-text")
|
||||||
.treeForMarkdownItBundle();
|
.treeForMarkdownItBundle();
|
||||||
|
|
||||||
const terserPlugin = app.project.findAddonByName("ember-cli-terser");
|
return app.toTree([
|
||||||
const applyTerser = (tree) => terserPlugin.postprocessTree("all", tree);
|
|
||||||
|
|
||||||
return mergeTrees([
|
|
||||||
createI18nTree(discourseRoot, vendorJs),
|
createI18nTree(discourseRoot, vendorJs),
|
||||||
parsePluginClientSettings(discourseRoot, vendorJs, app),
|
parsePluginClientSettings(discourseRoot, vendorJs, app),
|
||||||
app.toTree(),
|
|
||||||
funnel(`${discourseRoot}/public/javascripts`, { destDir: "javascripts" }),
|
funnel(`${discourseRoot}/public/javascripts`, { destDir: "javascripts" }),
|
||||||
funnel(`${vendorJs}/highlightjs`, {
|
funnel(`${vendorJs}/highlightjs`, {
|
||||||
files: ["highlight-test-bundle.min.js"],
|
files: ["highlight-test-bundle.min.js"],
|
||||||
destDir: "assets/highlightjs",
|
destDir: "assets/highlightjs",
|
||||||
}),
|
}),
|
||||||
generateWorkboxTree(),
|
generateWorkboxTree(),
|
||||||
applyTerser(
|
concat(adminTree, {
|
||||||
concat(adminTree, {
|
inputFiles: ["**/*.js"],
|
||||||
inputFiles: ["**/*.js"],
|
outputFile: `assets/admin.js`,
|
||||||
outputFile: `assets/admin.js`,
|
}),
|
||||||
})
|
concat(wizardTree, {
|
||||||
),
|
inputFiles: ["**/*.js"],
|
||||||
applyTerser(
|
outputFile: `assets/wizard.js`,
|
||||||
concat(wizardTree, {
|
}),
|
||||||
inputFiles: ["**/*.js"],
|
concat(markdownItBundleTree, {
|
||||||
outputFile: `assets/wizard.js`,
|
inputFiles: ["**/*.js"],
|
||||||
})
|
outputFile: `assets/markdown-it-bundle.js`,
|
||||||
),
|
}),
|
||||||
applyTerser(
|
|
||||||
concat(markdownItBundleTree, {
|
|
||||||
inputFiles: ["**/*.js"],
|
|
||||||
outputFile: `assets/markdown-it-bundle.js`,
|
|
||||||
})
|
|
||||||
),
|
|
||||||
generateScriptsTree(app),
|
generateScriptsTree(app),
|
||||||
applyTerser(discoursePluginsTree),
|
discoursePluginsTree,
|
||||||
]);
|
]);
|
||||||
};
|
};
|
||||||
|
Loading…
Reference in New Issue
Block a user