forked from hashicorp/vault
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathember-cli-build.js
98 lines (88 loc) · 2.49 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
/**
* Copyright (c) HashiCorp, Inc.
* SPDX-License-Identifier: BUSL-1.1
*/
/* eslint-env node */
'use strict';
const EmberApp = require('ember-cli/lib/broccoli/ember-app');
const config = require('./config/environment')();
const environment = EmberApp.env();
const isProd = environment === 'production';
const isTest = environment === 'test';
// const isCI = !!process.env.CI;
const appConfig = {
'ember-service-worker': {
serviceWorkerScope: config.serviceWorkerScope,
skipWaitingOnMessage: true,
},
svgJar: {
//optimize: false,
//paths: [],
optimizer: {},
sourceDirs: ['node_modules/@hashicorp/structure-icons/dist', 'public'],
rootURL: '/ui/',
},
fingerprint: {
exclude: ['images/'],
},
assetLoader: {
generateURI: function (filePath) {
return `${config.rootURL.replace(/\/$/, '')}${filePath}`;
},
},
babel: {
plugins: [['inline-json-import', {}]],
},
hinting: isTest,
tests: isTest,
sourcemaps: {
enabled: !isProd,
},
sassOptions: {
sourceMap: false,
onlyIncluded: true,
precision: 4,
includePaths: [
'./node_modules/@hashicorp/design-system-components/app/styles',
'./node_modules/@hashicorp/design-system-tokens/dist/products/css',
],
},
minifyCSS: {
options: {
advanced: false,
},
},
autoprefixer: {
enabled: isTest || isProd,
grid: true,
browsers: ['defaults'],
},
autoImport: {
forbidEval: true,
},
'ember-test-selectors': {
strip: isProd,
},
'ember-composable-helpers': {
except: ['array'],
},
'ember-cli-deprecation-workflow': {
enabled: true,
},
};
module.exports = function (defaults) {
const app = new EmberApp(defaults, appConfig);
app.import('vendor/string-includes.js');
app.import('node_modules/string.prototype.endswith/endswith.js');
app.import('node_modules/string.prototype.startswith/startswith.js');
app.import('node_modules/jsonlint/lib/jsonlint.js');
app.import('node_modules/codemirror/addon/lint/lint.css');
app.import('node_modules/codemirror/lib/codemirror.css');
app.import('node_modules/text-encoder-lite/text-encoder-lite.js');
app.import('node_modules/jsondiffpatch/dist/jsondiffpatch.umd.js');
app.import('node_modules/jsondiffpatch/dist/formatters-styles/html.css');
app.import('app/styles/bulma/bulma-radio-checkbox.css');
app.import('node_modules/@hashicorp/structure-icons/dist/loading.css');
app.import('node_modules/@hashicorp/structure-icons/dist/run.css');
return app.toTree();
};