-
Notifications
You must be signed in to change notification settings - Fork 9
/
Copy pathindex.js
37 lines (30 loc) · 844 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
'use strict';
var path = require('path');
var Funnel = require('broccoli-funnel');
var MergeTrees = require('broccoli-merge-trees');
var map = require('broccoli-stew').map;
module.exports = {
name: require('./package').name,
included(app) {
this._super.included.apply(this, arguments);
if (typeof app.import !== 'function' && app.app) {
app = app.app;
}
app.import('vendor/printThis.js');
},
treeForVendor(vendorTree) {
var printThisTree = new Funnel(
path.dirname(require.resolve('print-this/printThis.js')),
{
files: ['printThis.js'],
}
);
printThisTree = map(
printThisTree,
(content) => `if (typeof FastBoot === 'undefined') { ${content} }`
);
return vendorTree
? new MergeTrees([vendorTree, printThisTree])
: printThisTree;
},
};