-
Notifications
You must be signed in to change notification settings - Fork 10
/
ember-cli-build.js
125 lines (103 loc) · 3.33 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
117
118
119
120
121
122
123
124
125
'use strict';
const EmberApp = require('ember-cli/lib/broccoli/ember-app');
// eslint-disable-next-line n/no-extraneous-require
const writeFile = require('broccoli-file-creator');
// eslint-disable-next-line n/no-extraneous-require
const MergeTrees = require("broccoli-merge-trees");
const env = EmberApp.env();
const IS_PROD = env === 'production', IS_TEST = env === 'test';
process.on('uncaughtException', function (err) {
console.error(err.stack);
});
module.exports = function (defaults) {
let app = new EmberApp(defaults, {
babel: {
loose: true,
plugins: [require.resolve('ember-auto-import/babel-plugin')],
},
// Don't even generate test files unless a test build
tests: IS_TEST,
// Don't store configuration in meta tag
storeConfigInMeta: false,
'@embroider/macros': {
setConfig: {
'ember-data/store': {
polyfillUUID: true
},
},
},
'ember-cli-terser': {
enabled: IS_PROD,
},
'ember-simple-auth': {
useSessionSetupMethod: true,
},
'ember-cli-deprecation-workflow': {
enabled: true,
},
minifyCSS: {
enabled: false, // minification causes the selectors to be reordered!!
},
sassOptions: {
onlyIncluded: false,
includePaths: [
'node_modules/cropperjs/src/css',
'node_modules/ember-bootstrap/'
]
},
'ember-bootstrap': {
bootstrapVersion: 5,
importBootstrapCSS: false,
insertEmberWormholeElementToDom: false,
},
autoImport: {
webpack: {
module: {
rules: [
{
test: /\.css$/,
resourceQuery: /raw/,
type: 'asset/source',
}
]
},
resolve: {
fallback: {
fs: false
}
},
},
// Work around for ember-auto-import v2.6 regression & ember-bootstrap
earlyBootSet: () => [],
}
});
// Use `app.import` to add additional libraries to the generated
// output files.
// app.import('node_modules/@okta/okta-signin-widget/dist/css/okta-sign-in.min.css');
/*
app.import(`node_modules/dayjs/plugin/advancedFormat.js`);
app.import(`node_modules/dayjs/plugin/objectSupport.js`);
app.import(`node_modules/dayjs/plugin/utc.js`);
app.import(`node_modules/dayjs/plugin/timezone.js`);
app.import('node_modules/dayjs/plugin/dayOfYear.js');
*/
app.import('node_modules/@eonasdan/tempus-dominus/dist/css/tempus-dominus.min.css');
// 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.
if (!IS_PROD) {
return app.toTree();
}
// Create a buildstamp file to be used by <NewVersionNotify /> in production.
const config = app.project.config();
const fileName = config.newVersion.fileName;
const buildTimestamp = config.APP.buildTimestamp;
const buildStampFile = writeFile(fileName, buildTimestamp);
return new MergeTrees([app.toTree(), buildStampFile]);
};