mirror of
https://github.com/discourse/discourse.git
synced 2024-11-25 23:33:37 +08:00
97847f6cd8
This reverts commit 0f4520867b
.
This has led to two problems:
1. An incompatibility with Cloudflare's "auto minify" feature. They've deprecated this feature because of incompatibility with modern JS syntax. But unfortunately it will remain enabled on existing properties until 2024-08-05.
2. Discourse fails to boot in Safari 15. This is strange, because Safari does support all the required features in our production JS bundles. Even more strangely, things start working as soon as you open the developer tools. That suggests the cause could be a Safari bug rather than a simple incompatibility.
Reverting while we work out a path forward on both those issues.
32 lines
866 B
JavaScript
32 lines
866 B
JavaScript
"use strict";
|
|
|
|
const calculateCacheKeyForTree = require("calculate-cache-key-for-tree");
|
|
const path = require("path");
|
|
|
|
module.exports = {
|
|
name: require("./package").name,
|
|
|
|
// return an empty tree here as we do not want the addon modules to be
|
|
// included into vendor.js; instead, we will produce a separate bundle
|
|
// (admin.js) to be included via a script tag as needed
|
|
treeForAddon() {
|
|
return;
|
|
},
|
|
|
|
// custom method to produce the tree for admin.js
|
|
// called by ember-cli-build.js in discourse core
|
|
treeForAddonBundle() {
|
|
let addonTreePath = path.resolve(this.root, this.treePaths.addon);
|
|
let addonTree = this.treeGenerator(addonTreePath);
|
|
return this._super.treeForAddon.call(this, addonTree);
|
|
},
|
|
|
|
cacheKeyForTree(tree) {
|
|
return calculateCacheKeyForTree(tree, this);
|
|
},
|
|
|
|
isDevelopingAddon() {
|
|
return true;
|
|
},
|
|
};
|