-
Notifications
You must be signed in to change notification settings - Fork 3
/
index.js
70 lines (51 loc) · 1.87 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
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
/* jshint node: true */
'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: 'videojs',
included: function(app) {
this._super.included.apply(this, arguments);
let options = app.options.videojs || {};
app.import({
development: path.join('vendor/video-js.css'),
production: path.join('vendor/video-js.min.css')
});
app.import(path.join('vendor/font/VideoJS.eot'), { destDir: 'assets/font' });
app.import(path.join('vendor/font/VideoJS.svg'), { destDir: 'assets/font' });
app.import(path.join('vendor/font/VideoJS.ttf'), { destDir: 'assets/font' });
app.import(path.join('vendor/font/VideoJS.woff'), { destDir: 'assets/font' });
app.import('vendor/ember-cli-videojs-shim/shims.js', {
exports: {
videojs: ['default']
}
});
app.import({
development: path.join('vendor/video.js'),
production: path.join('vendor/video.min.js')
});
(options.languages || []).forEach(function(language) {
app.import(path.join('vendor/lang/' + language + '.js'));
});
app.import(path.join('vendor/video-js.swf'), { destDir: 'assets' });
},
treeForVendor(vendorTree) {
let trees = [];
if (vendorTree) {
trees.push(vendorTree);
}
let src = path.join(path.dirname(require.resolve('video.js')));
let videojsLib = new Funnel(src, {
include: ['lang/*', '*.js']
});
videojsLib = map(videojsLib, (content) => `if (typeof FastBoot === 'undefined') { ${content} }`);
trees.push(videojsLib);
let videojsAssets = new Funnel(src, {
exclude: ['lang/*', '*.js', '*.zip', 'examples', 'alt']
});
trees.push(videojsAssets);
return new MergeTrees(trees);
},
};