-
Notifications
You must be signed in to change notification settings - Fork 0
/
webpack.config.mjs
63 lines (57 loc) · 1.14 KB
/
webpack.config.mjs
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
import TerserPlugin from 'terser-webpack-plugin';
import babel from './.babelrc.client.js';
import path from 'path';
import webpack from 'webpack';
// Return module
export default {
mode: 'production',
module: {
rules: [
{
exclude: /node_modules/,
type: 'javascript/auto',
test: /\.m?js$/,
use: [{
loader: 'babel-loader',
options: babel,
}],
},
],
},
output: {
chunkFilename: '[name]-[chunkhash].min.js',
filename: '[name].min.js',
path: path.resolve('./dist/assets/js'),
publicPath: '/assets/js/',
},
optimization: {
minimizer: [new TerserPlugin({
sourceMap: true,
terserOptions: {
compress: {
ie8: true,
warnings: false,
},
mangle: {
ie8: true,
},
output: {
comments: false,
ie8: true,
},
},
})],
},
plugins: [
new webpack.SourceMapDevToolPlugin({
filename: '[name].min.js.map',
publicPath: '/assets/js/',
}),
],
resolve: {
modules: [
'./node_modules',
`./src/assets/js`,
],
},
};