-
Notifications
You must be signed in to change notification settings - Fork 9
/
index.js
42 lines (34 loc) · 966 Bytes
/
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
'use strict';
var path = require('path');
var dirname = path.dirname;
var join = path.join;
var resolve = path.resolve;
var mergeTrees = require('broccoli-merge-trees');
var Funnel = require('broccoli-funnel');
module.exports = {
name: 'ember-element-resize-detector',
included: function(app) {
if (app.app) {
app = app.app;
}
this.app = app;
if (!process.env.EMBER_CLI_FASTBOOT) {
app.import('vendor/element-resize-detector/element-resize-detector.js');
}
},
treeForVendor: function(tree) {
var trees = [];
if (tree) {
trees.push(tree);
}
var erdSrc = dirname(require.resolve('element-resize-detector'));
var erdPath = resolve(join(erdSrc, '..', 'dist'));
var erdTree = new Funnel(this.treeGenerator(erdPath), {
srcDir: '/',
files: ['element-resize-detector.js'],
destDir: 'element-resize-detector'
});
trees.push(erdTree);
return mergeTrees(trees);
}
};