-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathindex.js
49 lines (40 loc) · 1.26 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
49
'use strict';
const path = require('path');
const pkg = require('./package.json');
const json = require('broccoli-json-module');
const mergeTrees = require('broccoli-merge-trees');
const funnel = require('broccoli-funnel');
const esTranspiler = require('broccoli-babel-transpiler');
const compileLess = require('broccoli-less-single');
module.exports = {
name: 'ember-emoji',
isDevelopingAddon() {
return process.env.EMOJI_DEV_MODE;
},
treeForVendor(tree) {
this._super(...arguments);
const location = path.dirname(require.resolve('emojione/emoji.json'));
const jsonFunnel = funnel(location, {
files: ['emoji.json']
});
const jsonTree = esTranspiler(json(jsonFunnel), {
compact: true,
moduleRoot: pkg.name,
plugins: [
'babel-plugin-transform-es2015-modules-amd'
],
moduleIds: true
});
const trees = [jsonTree];
if (tree) {
trees.push(tree);
}
return mergeTrees(trees);
},
included() {
this._super(...arguments);
this.import(require.resolve('emojione'));
this.import('vendor/shims/emojione.js');
this.import('vendor/emoji.js');
}
};