-
Notifications
You must be signed in to change notification settings - Fork 0
/
webpack.config.js
56 lines (53 loc) · 1.44 KB
/
webpack.config.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
const path = require('path');
const TerserPlugin = require("terser-webpack-plugin");
module.exports = ( env ) => {
let config = {
mode: 'production',
entry: {
database: [
'./src/js/components/timer.js',
'./src/js/pages/database.js'
],
signin: './src/js/pages/signin.js',
"plan-selection": './src/js/pages/plan-selection.js',
"account": './src/js/pages/account.js',
"help": './src/js/pages/help.js',
"meetings": './src/js/pages/meetings.js',
"accounting-template": './src/js/pages/accounting-template.js',
"confirm-email": './src/js/pages/confirm-email.js',
"forgot-password": './src/js/pages/forgot-password.js',
"reset-password": './src/js/pages/reset-password.js',
"form": './src/js/pages/form.js',
"tracking": './src/js/pages/tracking.js',
index: './src/js/index.js',
},
output: {
filename: '[name].min.js',
path: path.resolve(__dirname, 'public/js'),
},
module: {
rules: [
{
test: /\.(woff|woff2|eot|ttf|otf)$/i,
type: 'asset/resource',
}
],
},
optimization: {
minimize: true,
minimizer: [
new TerserPlugin({
terserOptions: {
compress: true,
},
}),
],
},
}
if ( env.dev ) {
config.mode = 'development';
config.devtool = "inline-source-map";
config.watch = true;
}
return config;
};