-
Notifications
You must be signed in to change notification settings - Fork 53
/
Copy pathindex.js
65 lines (52 loc) · 1.63 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
'use strict';
const Funnel = require('broccoli-funnel');
const Merge = require('broccoli-merge-trees');
const path = require('path');
const existsSync = require('exists-sync');
const fastbootTransform = require('fastboot-transform');
module.exports = {
name: require('./package').name,
included: function (app) {
this._super.included(app);
var config = this.app.project.config(app.env) || {};
var addonConfig = config[this.name] || {};
var debugMode = addonConfig.debug;
if (debugMode === undefined) {
debugMode = process.env.EMBER_ENV === 'development';
}
if (debugMode) {
app.import('vendor/plupload/moxie.js');
app.import('vendor/plupload/plupload.dev.js');
} else {
app.import('vendor/plupload/plupload.full.min.js');
}
app.import('bower_components/plupload/js/Moxie.swf', {
destDir: 'assets'
});
app.import('bower_components/plupload/js/Moxie.xap', {
destDir: 'assets'
});
app.import('bower_components/dinosheets/dist/dinosheets.amd.js', {
exports: {
'dinosheets': ['default']
}
});
app.import('vendor/styles/ember-plupload.css');
},
treeForVendor(tree) {
let trees = [];
if (tree) {
trees.push(tree);
}
const app = this._findHost();
let assetDir = path.join(this.project.root, app.bowerDirectory, 'plupload', 'js');
if (existsSync(assetDir)) {
const browserTrees = fastbootTransform(new Funnel(assetDir, {
files: ['moxie.js', 'plupload.dev.js', 'plupload.full.min.js'],
destDir: 'plupload'
}));
trees.push(browserTrees);
}
return new Merge(trees);
}
};