forked from ember-learn/ember-api-docs
-
Notifications
You must be signed in to change notification settings - Fork 0
/
ember-cli-build.js
57 lines (47 loc) · 1.42 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
/* eslint-env node: true */
let EmberApp = require('ember-cli/lib/broccoli/ember-app');
module.exports = function(defaults) {
let prepend = '';
if ('FASTLY_CDN_URL' in process.env) {
prepend = `https://${process.env.FASTLY_CDN_URL}/`;
}
let app = new EmberApp(defaults, {
fingerprint: {
extensions: ['js', 'css', 'jpg', 'png', 'gif', 'map', 'svg'],
prepend: prepend,
generateAssetMap: true
},
sassOptions: {
includePaths: [
'app/styles',
'bower_components/neat/app/assets/stylesheets',
'bower_components/bitters/core'
]
},
autoprefixer: {
browsers: ['last 2 versions']
},
'ember-composable-helpers': {
only: ['join', 'map-by']
},
'asset-cache': {
version: '4', //Might have to change this with the app build,
prepend
},
});
var docsSlug = process.env.DOCS_SLUG ? process.env.DOCS_SLUG : '/api-new/';
//TODO move the proxying main site to a variable for testing & dev
app.options['ember-service-worker'] = {
rootUrl: app.env.environment === 'production' ? 'https://emberjs.com' + docsSlug : '/'
};
app.options['esw-cache-first'] = {
patterns: [
`${app.env.API_HOST}/json-docs-1/(.+)`,
`${app.env.API_HOST}/rev-index/(.+)`
]
};
if (!process.env.EMBER_CLI_FASTBOOT) {
app.import(app.bowerDirectory + '/jquery-scrollparent/jquery.scrollparent.js');
}
return app.toTree();
};