discourse/app/assets/javascripts/admin/index.js
David Taylor 97847f6cd8
Revert "DEV: @babel/plugin-proposal-decorators -> decorator-transforms (#25290)" (#26971)
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.
2024-05-10 12:48:16 +01:00

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;
},
};