2020-09-22 14:18:47 -04:00
|
|
|
"use strict";
|
|
|
|
|
|
|
|
const calculateCacheKeyForTree = require("calculate-cache-key-for-tree");
|
2023-07-10 17:07:21 -04:00
|
|
|
const path = require("path");
|
2020-09-22 14:18:47 -04:00
|
|
|
|
|
|
|
module.exports = {
|
|
|
|
name: require("./package").name,
|
2023-07-10 17:07:21 -04: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-22 14:18:47 -04:00
|
|
|
return;
|
|
|
|
},
|
|
|
|
|
2023-07-10 17:07:21 -04: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-22 14:18:47 -04:00
|
|
|
cacheKeyForTree(tree) {
|
|
|
|
return calculateCacheKeyForTree(tree, this);
|
|
|
|
},
|
|
|
|
|
|
|
|
isDevelopingAddon() {
|
|
|
|
return true;
|
|
|
|
},
|
|
|
|
};
|