-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathember-cli-build.js
103 lines (96 loc) · 2.71 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
'use strict';
const EmberAddon = require('ember-cli/lib/broccoli/ember-addon');
const isProduction = EmberAddon.env() === 'production';
const isTesting = EmberAddon.env() === 'test';
const isDevelopment = !isProduction;
console.info('ENVIRONMENT:', EmberAddon.env()); // eslint-disable-line
const origin = '';
module.exports = function(defaults) {
let app = new EmberAddon(defaults, {
origin,
'tests': isTesting,
'hinting': isTesting,
'storeConfigInMeta': isDevelopment,
'ember-fetch': {
preferNative: true
},
'ember-welcome-page': {
enabled: false
},
'sassOptions': {
includePaths: [
'app/styles',
'node_modules/ember-paper/app/styles'
]
},
'SRI': {
origin,
enabled: false
},
'fingerprint': {
prepend: origin,
enabled: false, // isProduction - breaks ember cli amp
extensions: ['js', 'css', 'map', 'webmanifest'],
exclude: [
'waveWorker.min.js',
'engine.js', 'engine.css',
'engine-vendor.js', 'engine-vendor.css'
]
},
'autoprefixer': {
enabled: isProduction
},
'minifyJS': {
enabled: isProduction
},
'minifyCSS': {
enabled: isProduction,
options: { processImport: false }
},
'minifyHTML': {
enabled: isProduction,
htmlFiles: ['index.html'] // index.amp.html - breaks production build because brotli cannot find it
},
'sourcemaps': {
compileModules: true,
enabled: isProduction,
extensions: ['js', 'css', 'scss']
},
'ember-cli-babel': {
compileModules: true,
disablePresetEnv: false,
disableDebugTooling: false,
includeExternalHelpers: true,
includePolyfill: isProduction,
throwUnlessParallelizable: false,
disableDecoratorTransforms: false,
disableEmberModulesAPIPolyfill: false,
disableEmberDataPackagesPolyfill: false
},
'babel': {
debug: false,
useBuiltIns: false,
sourceMaps: isProduction,
plugins: [
'ember-auto-import/babel-plugin',
'@babel/plugin-syntax-top-level-await',
'@babel/plugin-transform-block-scoping',
'@babel/plugin-proposal-throw-expressions',
'@babel/plugin-proposal-optional-chaining',
'@babel/plugin-proposal-object-rest-spread',
'@babel/plugin-proposal-export-namespace-from',
'@babel/plugin-proposal-optional-catch-binding',
'@babel/plugin-proposal-nullish-coalescing-operator',
'@babel/plugin-proposal-logical-assignment-operators',
['@babel/plugin-proposal-pipeline-operator', { 'proposal': 'minimal' }]
]
}
});
/*
This build file specifies the options for the dummy test app of this
addon, located in `/tests/dummy`
This build file does *not* influence how the addon or the app using it
behave. You most likely want to be modifying `./index.js` or app's build file
*/
return app.toTree();
};