-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.js
41 lines (36 loc) · 1.07 KB
/
index.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
'use strict';
const MergeTrees = require('broccoli-merge-trees');
const writeFile = require('broccoli-file-creator');
const defaults = {
proxyClassicSupport: false,
stallThreshold: 5000,
version: {
zuglet: require('./package.json').version,
firebase: require('firebase/package.json').version
}
};
module.exports = {
name: 'zuglet',
isDevelopingAddon() {
return true;
},
included(app, parentAddon) {
this._super.included.apply(this, arguments);
this.zuglet = Object.assign({}, defaults, (parentAddon || app).options['zuglet']);
app.import('vendor/zuglet/fastboot.js');
},
treeForAddon() {
let tree = this._super.treeForAddon.apply(this, arguments);
return MergeTrees([
tree,
writeFile('-private/flags.js', `define('zuglet/-private/flags', [ 'exports' ], function(_exports) {
"use strict";
Object.defineProperty(_exports, "__esModule", {
value: true
});
var _default = Object.freeze(${JSON.stringify(this.zuglet, null, 2)});
_exports.default = _default;
});`)
]);
}
};