forked from bustle/ember-mobiledoc-editor
-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.js
53 lines (46 loc) · 1.32 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
50
51
52
53
/* jshint node: true */
'use strict';
var MergeTrees = require('broccoli-merge-trees');
var Funnel = require('broccoli-funnel');
var path = require('path');
function distDirFor(packageName) {
try {
var resolved = require.resolve(packageName + '/package.json');
return path.join(path.dirname(resolved), 'dist');
} catch (e) {
return null;
}
}
module.exports = {
name: 'ember-mobiledoc-editor',
treeForVendor: function() {
var files = [];
files.push(new Funnel(distDirFor('mobiledoc-kit'), {
files: [
'css/mobiledoc-kit.css',
'amd/mobiledoc-kit.js',
'amd/mobiledoc-kit.map'
],
destDir: 'mobiledoc-kit'
}));
var rendererDir = distDirFor('mobiledoc-dom-renderer');
if (rendererDir) {
files.push(new Funnel(rendererDir, {
files: [
'amd/mobiledoc-dom-renderer.js',
'amd/mobiledoc-dom-renderer.map'
],
destDir: 'mobiledoc-dom-renderer'
}));
}
return new MergeTrees(files);
},
included: function(app) {
app.import('vendor/mobiledoc-kit/css/mobiledoc-kit.css');
app.import('vendor/mobiledoc-kit/amd/mobiledoc-kit.js');
var rendererDir = distDirFor('mobiledoc-dom-renderer');
if (rendererDir) {
app.import('vendor/mobiledoc-dom-renderer/amd/mobiledoc-dom-renderer.js');
}
}
};