forked from weteachme/ember-stripe-payment
-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.js
48 lines (34 loc) · 1.04 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
/* eslint-env node */
'use strict';
const path = require('path');
const Funnel = require('broccoli-funnel');
const MergeTrees = require('broccoli-merge-trees');
const map = require('broccoli-stew').map;
module.exports = {
name: 'ember-gestures',
included(app) {
this._super.included.apply(this, arguments);
// see: https://github.com/ember-cli/ember-cli/issues/3718
if (typeof app.import !== 'function' && app.app) {
app = app.app;
}
app.import('vendor/jquery.payment.min.js');
},
treeForVendor(vendorTree) {
let trees = [];
const app = this._findHost();
const assetPath = app.bowerDirectory + '/jquery.payment/lib/';
let hammerTree = new Funnel(assetPath, {
files: ['jquery.payment.min.js']
});
hammerTree = map(hammerTree, (content) => `if (typeof FastBoot === 'undefined') { ${content} }`);
if (vendorTree !== undefined) {
trees.push(vendorTree);
}
trees.push(hammerTree);
return new MergeTrees(trees);
},
isDevelopingAddon() {
return false;
}
};