2020-09-23 02:18:47 +08:00
|
|
|
"use strict";
|
|
|
|
|
|
|
|
const calculateCacheKeyForTree = require("calculate-cache-key-for-tree");
|
2023-07-11 05:07:21 +08:00
|
|
|
const path = require("path");
|
2024-06-10 22:51:48 +08:00
|
|
|
const commonBabelConfig = require("../discourse/lib/common-babel-config");
|
2020-09-23 02:18:47 +08:00
|
|
|
|
|
|
|
module.exports = {
|
|
|
|
name: require("./package").name,
|
2023-07-11 05:07:21 +08:00
|
|
|
|
2024-06-10 22:51:48 +08:00
|
|
|
options: {
|
|
|
|
...commonBabelConfig(),
|
|
|
|
},
|
|
|
|
|
2023-07-11 05:07:21 +08:00
|
|
|
// 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() {
|
2020-09-23 02:18:47 +08:00
|
|
|
return;
|
|
|
|
},
|
|
|
|
|
2023-07-11 05:07:21 +08:00
|
|
|
// 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);
|
|
|
|
},
|
|
|
|
|
2020-09-23 02:18:47 +08:00
|
|
|
cacheKeyForTree(tree) {
|
|
|
|
return calculateCacheKeyForTree(tree, this);
|
|
|
|
},
|
|
|
|
|
|
|
|
isDevelopingAddon() {
|
|
|
|
return true;
|
|
|
|
},
|
|
|
|
};
|