forked from johno/ember-cli-gravatar
-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.js
37 lines (30 loc) · 901 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
/* jshint node: true */
'use strict';
var Funnel = require('broccoli-funnel');
var MergeTrees = require('broccoli-merge-trees');
var Path = require('path');
module.exports = {
name: 'ember-cli-gravatar',
included: function included(app) {
// workaround for https://github.com/ember-cli/ember-cli/issues/3718
if (typeof app.import !== 'function' && app.app) {
app = app.app;
}
this.app = app;
this._super.included(app);
app.import('vendor/md5.js');
app.import('vendor/ember-cli-gravatar/md5-shim.js', {
type: 'vendor',
exports: { 'md5': ['md5'] }
});
},
treeForVendor: function treeForVendor(vendorTree) {
var md5Tree = new Funnel(Path.dirname(require.resolve('blueimp-md5/js/md5.js')), {
files: [ 'md5.js' ],
});
if (vendorTree) {
return new MergeTrees([ vendorTree, md5Tree ]);
}
return md5Tree;
}
};