forked from rundis/elm-bootstrap.info
-
Notifications
You must be signed in to change notification settings - Fork 0
/
webpack.config.prod.js
71 lines (67 loc) · 2 KB
/
webpack.config.prod.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
const CopyWebpackPlugin = require('copy-webpack-plugin');
const CleanWebpackPlugin = require('clean-webpack-plugin');
const UglifyJsPlugin = require('uglifyjs-webpack-plugin');
module.exports = {
mode: 'production',
module: {
rules: [
{
test: /\.html$/,
exclude: /node_modules/,
loader: 'file-loader?name=[name].[ext]'
},
{
test: /\.elm$/,
exclude: [/elm-stuff/, /node_modules/],
use: [
{ loader: "elm-webpack-loader"
, options: {
debug: false,
optimize: true
}}
],
}
]
},
plugins: [
new CleanWebpackPlugin(),
new CopyWebpackPlugin([
{ from: 'src/assets', to: 'assets'}
])
],
optimization: {
minimizer: [
new UglifyJsPlugin({
uglifyOptions: {
ecma: 5,
compress: {
dead_code: true,
pure_getters: true,
keep_fargs: false,
unsafe: true,
unsafe_comps: true,
pure_funcs: [
'_elm_lang$core$Native_Utils.update',
'A2',
'A3',
'A4',
'A5',
'A6',
'A7',
'A8',
'A9',
'F2',
'F3',
'F4',
'F5',
'F6',
'F7',
'F8',
'F9'
]
}
}
})
]
}
};