This repository has been archived by the owner on May 26, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2
/
ember-cli-build.js
116 lines (109 loc) · 3.08 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
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
'use strict';
const EmberApp = require('ember-cli/lib/broccoli/ember-app');
const Funnel = require('broccoli-funnel');
const gitRev = require('git-rev-sync');
const mergeTrees = require('broccoli-merge-trees');
module.exports = function (defaults) {
let disabledAddons = [];
let environment = EmberApp.env();
let isProduction = environment === 'production';
let swDisabled = process.env.SW_DISABLED;
let version = gitRev.short();
console.info('\n---------------');
console.info('environment: ', environment);
console.info('isProduction: ', isProduction);
console.info('SW_DISABLED: ', swDisabled);
console.info('git version: ', version);
console.info('---------------\n');
let app = new EmberApp(defaults, {
'ember-cli-babel': {
includePolyfill: true,
},
babel: {
sourceMaps: 'inline',
},
sourcemaps: {
enabled: !isProduction,
extensions: 'js',
},
babel: {
sourceMaps: 'inline',
},
eslint: {
testGenerator: 'qunit',
group: true,
rulesDir: 'eslint-rules',
extensions: ['js', 'ts'],
},
'ember-cli-qunit': {
useLintTree: false,
},
'ember-ci-mocha': {
useLintTree: false,
},
hinting: true,
minifyJS: { enabled: isProduction },
minifyCSS: { enabled: isProduction },
outputPaths: {
app: {
html: 'index.html',
},
},
autoImport: {
alias: {
qrcode: 'qrcode/build/qrcode.min.js',
'qr-scanner': 'qr-scanner/qr-scanner.min.js',
uuid: 'uuid/index.js',
},
exclude: ['libsodium', 'libsodium-wrappers'],
},
'ember-cli-babel': {
includePolyfill: true,
disablePresetEnv: true,
disableDebugTooling: false,
includeExternalHelpers: true,
// disableDebugTooling: isProduction,
// Will not build if uncommented:
// disableEmberModulesAPIPolyfill: true
// compileModules: false,
},
addons: { blacklist: disabledAddons },
'asset-cache': {
version,
include: ['assets/**/*', '**/*.html', 'index.html'],
exclude: ['.well-known/**/*', 'bundle.html', 'favicon.ico', 'robots.txt'],
},
'esw-index': {
version,
excludeScope: [
/\.well-known/,
/bundle.html/,
/favicon.ico/,
/robots.txt/,
],
},
sassOptions: {
extensions: ['js', 'scss'],
},
'ember-cli-qunit': {
useLintTree: false,
},
'ember-cli-mocha': {
useLintTree: false,
},
hinting: true,
});
// Use `app.import` to add additional libraries to the generated
// output files.
//
// If you need to use different assets in different
// environments, specify an object as the first parameter. That
// object's keys should be the environment name and the values
// should be the asset to use in that environment.
//
// If the library that you are including contains AMD or ES6
// modules that you would like to import into your application
// please specify an object with the list of modules as keys
// along with the exports of each module as its value.
return app.toTree();
};