forked from travis-ci/travis-web
-
Notifications
You must be signed in to change notification settings - Fork 1
/
ember-cli-build.js
69 lines (61 loc) · 1.73 KB
/
ember-cli-build.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
'use strict';
const EmberApp = require('ember-cli/lib/broccoli/ember-app');
const Funnel = require('broccoli-funnel');
module.exports = function () {
let fingerprint;
if (process.env.DISABLE_FINGERPRINTS) {
fingerprint = false;
} else {
fingerprint = {
exclude: ['images/emoji', 'images/logos'],
extensions: ['js', 'css', 'png', 'jpg', 'gif', 'map', 'svg']
};
if (process.env.TRAVIS_ENTERPRISE) {
fingerprint.prepend = '/';
} else {
let assetsHost = process.env.ASSETS_HOST;
if (assetsHost) {
if (assetsHost.substr(-1) !== '/') {
assetsHost = assetsHost + '/';
}
fingerprint.prepend = assetsHost;
} else if (process.env.DEPLOY_TARGET) {
const s3Bucket = require('./config/deploy')(process.env.DEPLOY_TARGET).s3.bucket;
fingerprint.prepend = '//' + s3Bucket + '.s3.amazonaws.com/';
}
}
}
const app = new EmberApp({
'ember-cli-babel': {
includePolyfill: true,
},
babel: {
blacklist: ['regenerator'],
plugins: [
'transform-decorators-legacy',
'transform-class-properties',
]
},
fingerprint: fingerprint,
sourcemaps: {
enabled: true,
extensions: ['js']
},
'ember-prism': {
'components': ['scss', 'javascript', 'json'], // needs to be an array, or undefined.
'plugins': ['line-highlight']
},
svg: {
optimize: false,
paths: [
'public/images/stroke-icons',
'public/images/svg'
]
}
});
app.import('node_modules/timeago/jquery.timeago.js');
const emojiAssets = new Funnel('node_modules/emoji-datasource-apple/img/apple/64', {
destDir: '/images/emoji'
});
return app.toTree(emojiAssets);
};