-
-
Notifications
You must be signed in to change notification settings - Fork 33
/
index.js
61 lines (50 loc) · 1.25 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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
/* jshint node: true */
'use strict';
var readEnvironmentConfig = require('./lib/environment-config').read;
var fastbootTransform = require('fastboot-transform');
module.exports = {
name: 'ember-cli-bugsnag',
options: {
nodeAssets: {
'@bugsnag/browser': {
vendor: {
srcDir: 'dist',
destDir: 'bugsnag-js',
include: ['bugsnag.js'],
processTree(input) {
return fastbootTransform(input);
}
}
}
}
},
config: function() {
return {
bugsnag: readEnvironmentConfig(process.env)
};
},
treeForAddon: function() {
if (this._includeBugsnag) {
return this._super.treeForAddon.apply(this, arguments);
}
},
treeForApp: function() {
if (this._includeBugsnag) {
return this._super.treeForApp.apply(this, arguments);
}
},
included: function(app) {
this._includeBugsnag =
this.isDevelopingAddon() || process.env.EMBER_ENV !== 'test';
this._super.included.apply(this, arguments);
if (this._includeBugsnag) {
app.import('vendor/bugsnag-js/bugsnag.js');
app.import('vendor/bugsnag/shim.js', {
type: 'vendor',
exports: {
Bugsnag: ['default']
}
});
}
}
};