-
Notifications
You must be signed in to change notification settings - Fork 11
/
Copy pathindex.js
51 lines (43 loc) · 1.62 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
'use strict';
const Funnel = require('broccoli-funnel');
const MergeTrees = require('broccoli-merge-trees');
const path = require('path');
module.exports = {
name: require('./package').name,
isDevelopingAddon: function () {
return true;
},
included: function (app) {
this._super.included.apply(this, arguments);
app.options = app.options || {};
if (app.options['ember-simple-auth'] !== undefined) {
app.options['ember-simple-auth'].useSessionSetupMethod = true;
} else {
app.options['ember-simple-auth'] = {
useSessionSetupMethod: true,
};
}
if (app.options['ember-cli-notifications'] !== undefined) {
app.options['ember-cli-notifications'].autoClear = true;
app.options['ember-cli-notifications'].clearDuration = 1000 * 3.5;
} else {
app.options['ember-cli-notifications'] = {
autoClear: true,
clearDuration: 1000 * 3.5,
};
}
},
treeForPublic: function () {
const publicTree = this._super.treeForPublic.apply(this, arguments);
const trees = [];
trees.push(
new Funnel(path.dirname(require.resolve('socketcluster-client')), {
files: ['socketcluster-client.min.js'],
destDir: '/assets',
allowEmpty: true,
})
);
// Merge the addon tree with the existing tree
return publicTree ? new MergeTrees([publicTree, ...trees], { overwrite: true }) : new MergeTrees([...trees], { overwrite: true });
},
};