forked from Skalar/ember-keyboard-shortcuts
-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.js
34 lines (30 loc) · 804 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
'use strict';
var path = require('path');
var Funnel = require('broccoli-funnel');
var mergeTrees = require('broccoli-merge-trees');
var fastbootTransform = require('fastboot-transform');
module.exports = {
name: require('./package').name,
included(app) {
this._super.included.apply(this, arguments);
app.import('vendor/mousetrap/mousetrap.js');
},
treeForVendor(tree) {
var trees = [];
var mousetrap = fastbootTransform(
new Funnel(this.pathBase('mousetrap'), {
destDir: 'mousetrap'
})
);
trees = trees.concat([mousetrap]);
if (tree) {
trees.push(tree);
}
return mergeTrees(trees);
},
pathBase(packageName) {
return path.dirname(
require.resolve(packageName + '/package.json', { basedir: __dirname })
);
}
};