FIX: Transpile start-discourse.js to fix iOS12 support (#18149)

33a2624f09 introduced a JS safe-navigation operator in `discourse-boot.js`. This needs to be transpiled to maintain iOS 12 support.
This commit is contained in:
David Taylor 2022-08-31 15:15:19 +01:00 committed by GitHub
parent de8cd19438
commit 564787d1dd
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 16 additions and 5 deletions

View File

@ -179,11 +179,6 @@ module.exports = function (defaults) {
})
),
applyTerser(prettyTextEngine(app)),
concat("public/assets/scripts", {
outputFile: `assets/start-discourse.js`,
headerFiles: [`start-app.js`],
inputFiles: [`discourse-boot.js`],
}),
generateScriptsTree(app),
applyTerser(discoursePluginsTree),
]);

View File

@ -35,5 +35,21 @@ module.exports = function scriptsTree(app) {
trees.push(transpiledWithDecodedSourcemap);
}
// start-discourse.js is a combination of start-app and discourse-boot
let startDiscourseTree = funnel(`public/assets/scripts`, {
files: ["start-app.js", "discourse-boot.js"],
destDir: "scripts",
});
startDiscourseTree = babelAddon.transpileTree(
startDiscourseTree,
babelConfig
);
startDiscourseTree = concat(startDiscourseTree, {
outputFile: `assets/start-discourse.js`,
headerFiles: [`scripts/start-app.js`],
inputFiles: [`scripts/discourse-boot.js`],
});
trees.push(startDiscourseTree);
return mergeTrees(trees);
};