-
Notifications
You must be signed in to change notification settings - Fork 11
/
ember-cli-build.js
95 lines (89 loc) · 2.38 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
'use strict';
const EmberApp = require('ember-cli/lib/broccoli/ember-app');
const webpack = require('webpack');
const defaultFingerprintExtensions =
require('broccoli-asset-rev/lib/default-options').extensions;
const environment = EmberApp.env();
const isProduction = environment === 'production' || environment === 'staging';
const minifyEnabled = isProduction;
module.exports = function (defaults) {
let app = new EmberApp(defaults, {
// Add options here
storeConfigInMeta: false,
babel: {
sourceMaps: 'inline',
plugins: [
require.resolve('ember-concurrency/async-arrow-task-transform'),
],
},
minifyJS: {
options: {
exclude: ['runtimeconfig.js'],
},
},
fingerprint: {
enabled: true,
exclude: ['runtimeconfig.js'],
extensions: defaultFingerprintExtensions.concat(['svg']),
},
sassOptions: {
includePaths: [
'node_modules/billboard.js/dist/',
'node_modules/material-icons/css/',
'node_modules/swagger-ui/dist/',
],
sourceMap: !isProduction,
sourceMapEmbed: !isProduction,
},
cssModules: {
intermediateOutputPath: 'app/styles/app.scss',
extension: 'scss',
},
autoprefixer: {
enabled: true,
cascade: true,
sourcemap: !isProduction,
},
dotEnv: {
clientAllowedKeys: ['AWS_BUCKET', 'AWS_REGION', 'WEBHOOK_URL'],
path: {
development: '.env.staging',
test: '.env.staging',
production: '.env',
staging: '.env.staging',
whitelabel: '.env',
},
},
sourcemaps: {
enabled: true,
},
'ember-date-components': {
includeCSS: false,
},
autoImport: {
webpack: {
// extra webpack configuration goes here
node: {
global: true,
},
plugins: [
new webpack.ProvidePlugin({
Buffer: ['buffer', 'Buffer'],
}),
],
resolve: {
fallback: {
fs: false,
stream: require.resolve('stream-browserify'),
buffer: require.resolve('buffer/'),
},
},
},
},
});
// Custom hacks to get a similar build in staging and production
app.options.minifyCSS.enabled = minifyEnabled;
app.options.minifyJS.enabled = minifyEnabled;
app.options.fingerprint.enabled = minifyEnabled;
return app.toTree();
};