forked from hummingbird-me/kitsu-web
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathember-cli-build.js
172 lines (153 loc) · 3.96 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
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
const EmberApp = require('ember-cli/lib/broccoli/ember-app');
const PostCSSFlex = require('postcss-flexbugs-fixes');
const Autoprefixer = require('autoprefixer');
const svgoUniqueIds = require('svgo-plugin-unify-ids');
const sass = require('sass');
const targets = require('./config/targets');
const environment = EmberApp.env();
const IS_PROD = environment === 'production';
const IS_TEST = environment === 'test';
const IS_DEV = environment === 'development';
module.exports = function(defaults) {
const app = new EmberApp(defaults, {
browseryStats: IS_DEV,
hinting: IS_TEST,
tests: IS_TEST,
babel: {
plugins: ['@babel/plugin-proposal-object-rest-spread']
},
'ember-cli-babel': {
includePolyfill: IS_PROD
},
'ember-cli-password-strength': {
bundleZxcvbn: false
},
autoprefixer: {
sourcemaps: false
},
sourcemaps: {
enabled: IS_PROD,
extensions: ['js']
},
outputPaths: {
app: {
css: {
'light-theme': '/assets/light.css',
'dark-theme': '/assets/dark.css'
}
}
},
sassOptions: {
implementation: sass,
includePaths: ['node_modules/bootstrap/scss']
},
postcssOptions: {
compile: { enabled: false },
filter: {
enabled: true,
plugins: [
{ module: PostCSSFlex },
{ module: Autoprefixer,
options: { browsers: targets.browsers }
}
]
}
},
fingerprint: {
generateAssetMap: true,
fingerprintAssetMap: true,
extensions: ['js', 'css', 'png', 'jpg', 'gif', 'map', 'json', 'webmanifest'],
exclude: [
'OneSignalSDKWorker.js',
'OneSignalSDKUpdaterWorker.js',
'apple-app-site-association',
'hulu-embed-frame.html'
]
},
svgJar: {
persist: false,
optimizer: {
plugins: [
{ removeTitle: true },
{ removeDesc: true },
{ removeXMLNS: true },
{ uniqueIds: svgoUniqueIds }
]
}
},
'ember-cli-workbox': {
enabled: true,
autoRegister: true,
debug: environment !== 'production'
},
workbox: {
swDest: '/sw.js',
skipWaiting: true,
clientsClaim: true,
sourcemap: false,
navigateFallback: '/index.html',
navigationPreload: false,
runtimeCaching: [
{
urlPattern: /^https:\/\/fonts\.gstatic\.com/,
handler: 'CacheFirst',
options: {
cacheName: 'google-fonts'
}
}
]
},
// assets
nodeAssets: {
autosize: {
srcDir: 'dist',
import: ['autosize.js']
},
clipboard: {
srcDir: 'dist',
import: ['clipboard.js']
},
cropperjs: {
srcDir: 'dist',
import: ['cropper.css', 'cropper.js']
},
flickity: {
srcDir: 'dist',
import: ['flickity.css']
},
getstream: {
srcDir: 'dist/js',
import: ['getstream.js']
},
hoverintent: {
srcDir: 'dist',
import: ['hoverintent.min.js']
}
},
emberApolloClient: {
keepGraphqlFileExtension: false
},
// Disable auto importing of manually imported packages listed below
autoImport: {
exclude: ['moment', 'moment-timezone', 'preferred-locale', 'algoliasearch', 'text-clipper']
}
});
// Work around for Ember 2.16.2 and Sourcemaps in production
app.import('node_modules/zxcvbn/dist/zxcvbn.js.map', { destDir: '.' });
app.import('node_modules/preferred-locale/lib/index.browser.js', {
using: [
{ transformation: 'amd', as: 'preferred-locale' }
]
});
app.import('node_modules/algoliasearch/dist/algoliasearchLite.min.js', {
using: [
{ transformation: 'amd', as: 'algoliasearch' }
]
});
app.import('node_modules/text-clipper/dist/index.js', {
using: [
{ transformation: 'cjs', as: 'text-clipper' }
]
});
return app.toTree();
};