-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathwebpack.config.cjs
45 lines (44 loc) · 999 Bytes
/
webpack.config.cjs
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
/* eslint-disable import/no-extraneous-dependencies */
const path = require('node:path');
const TerserPlugin = require('terser-webpack-plugin');
/** @type {require('webpack').Configuration} */
module.exports = {
mode: 'production',
cache: false,
devtool: false,
entry: {
'ios-calculator': './src/ios-calculator.js',
'ios-calculator.min': './src/ios-calculator.js',
},
optimization: {
minimize: true,
minimizer: [
new TerserPlugin({
include: /\.min\.js$/,
}),
],
},
output: {
path: path.resolve(__dirname, 'dist'),
filename: '[name].js',
clean: true,
},
module: {
rules: [
{
test: /\.m?js$/,
exclude: /(node_modules|bower_components)/,
loader: 'babel-loader',
},
{
test: /\.html$/i,
loader: 'html-loader',
},
{
test: /\.s[ac]ss$/i,
use: ['css-loader', 'postcss-loader', 'sass-loader'],
sideEffects: true,
},
],
},
};