-
-
Notifications
You must be signed in to change notification settings - Fork 4
/
ember-cli-build.js
60 lines (55 loc) · 1.46 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
'use strict';
const EmberApp = require('ember-cli/lib/broccoli/ember-app');
module.exports = function (defaults) {
const isProduction = process.env.EMBER_ENV === 'production';
const app = new EmberApp(defaults, {
babel: {
sourceMaps: 'inline',
plugins: [
...require('ember-cli-code-coverage').buildBabelPlugin({
embroider: true,
}),
'@babel/plugin-proposal-export-namespace-from',
],
},
'ember-cli-babel': { enableTypeScriptTransform: true },
sourcemaps: {
enabled: !isProduction,
extensions: ['js'],
},
});
const { Webpack } = require('@embroider/webpack');
return require('@embroider/compat').compatBuild(app, Webpack, {
packagerOptions: {
publicAssetURL: '/',
cssLoaderOptions: {
sourceMap: !isProduction,
modules: {
auto: true,
localIdentName: '[local]__[sha512:hash:base64:5]',
},
},
webpackConfig: {
module: {
rules: [
{
test: /\.css$/i,
exclude: /node_modules/,
use: [
{
loader: 'postcss-loader',
options: {
sourceMap: !isProduction,
postcssOptions: {
plugins: [require('autoprefixer')],
},
},
},
],
},
],
},
},
},
});
};