-
Notifications
You must be signed in to change notification settings - Fork 1
/
ember-cli-build.js
49 lines (42 loc) · 1.35 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
/* eslint-env node */
/* eslint no-console: 0 */
const fs = require('fs');
const path = require('path');
const EmberApp = require('ember-cli/lib/broccoli/ember-app');
const CDN_URL = process.env.CDN_URL || '';
let CLIENT_ID = process.env.CLIENT_ID || '';
const envPath = path.join(path.dirname(__filename), '.env');
if (fs.existsSync(envPath)) {
CLIENT_ID = require(envPath).CLIENT_ID;
console.info('Using client id:', CLIENT_ID);
}
module.exports = function (defaults) {
let app = new EmberApp(defaults, {
sourcemaps: {
enabled: true,
extensions: ['js']
},
replace: {
files: ['index.html', '**/*.js'],
patterns: [{
match: 'CDN_URL',
replacement: CDN_URL
}, {
match: 'CLIENT_ID',
replacement: CLIENT_ID
}],
},
"ember-cli-babel": {
includePolyfill: true
}
});
if (app.env === 'test') {
console.info('Not including App SDK during testing');
} else {
app.import('node_modules/purecloud-client-app-sdk/dist/purecloud-client-app-sdk.js');
}
app.import('node_modules/localforage/dist/localforage.js');
app.import('node_modules/markdown-it/dist/markdown-it.js');
app.import('vendor/shims/markdown-it.js');
return app.toTree();
};