-
Notifications
You must be signed in to change notification settings - Fork 11
Expand file tree
/
Copy pathindex.js
More file actions
30 lines (26 loc) · 826 Bytes
/
index.js
File metadata and controls
30 lines (26 loc) · 826 Bytes
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
'use strict';
var path = require('path');
var broccoliFunnel = require('broccoli-funnel');
var broccoliMergeTrees = require('broccoli-merge-trees');
var map = require('broccoli-stew').map;
module.exports = {
name: 'ember-cli-fastclick',
included(app) {
this._super.included(app);
app.import(this.treePaths.vendor + '/fastclick/fastclick.js');
},
treeForVendor(defaultTree) {
var trees = [];
if (defaultTree) {
trees.push(defaultTree);
}
var libPath = path.dirname(require.resolve('fastclick'));
var fastclickLib = new broccoliFunnel(libPath, {
destDir: 'fastclick',
include: ['*']
});
fastclickLib = map(fastclickLib, content => `if (typeof FastBoot === 'undefined') { ${content} }`);
trees.push(fastclickLib);
return broccoliMergeTrees(trees);
}
};