UNPKG

527 BJavaScriptView Raw
1module.exports = {
2 name: require('./package').name,
3 treeFor() {
4 // Nested addons don't call isEnabled automatically,
5 // So this ensures that we return empty trees whenever
6 // we are not enabled.
7 if (this.isEnabled()) {
8 return this._super.treeFor.call(this, ...arguments);
9 }
10 },
11 isEnabled() {
12 if (this.__isEnabled !== undefined) {
13 return this.__isEnabled;
14 }
15 const env = process.env.EMBER_ENV;
16
17 this.__isEnabled = env !== 'production';
18
19 return this.__isEnabled;
20 },
21};