-
Notifications
You must be signed in to change notification settings - Fork 0
/
webpack.config.js
77 lines (76 loc) · 3.26 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
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
const path = require('path');
const HtmlWebpackPlugin = require('html-webpack-plugin');
const FaviconsWebpackPlugin = require('favicons-webpack-plugin');
const MiniCssExtractPlugin = require('mini-css-extract-plugin');
module.exports = {
mode: 'production',
entry: './src/index.js',
devtool: 'source-map',
devServer: {
static: './dist',
},
performance: {
hints: false,
},
plugins: [
new HtmlWebpackPlugin({
title: 'To Do Or Not',
template: './src/template.html',
filename: 'index.html',
showErrors: true,
inject: true,
minify: 'auto',
}),
new HtmlWebpackPlugin({
title: 'Dialog Form Content',
template: './src/dialogFormContent.html',
filename: 'dialogFormContent.html', // Adjust the filename and path as needed
inject: false, // Don't inject any assets into this HTML file
}),
new FaviconsWebpackPlugin({
logo: './src/assets/img/favicons/favicon.png',
mode: 'auto', // optional can be 'webapp', 'light' or 'auto' - 'auto' by default
devMode: 'webapp', // optional can be 'webapp' or 'light' - 'light' by default
favicons: {
developerURL: null, // prevent retrieving from the nearest package.json
background: '#ddd',
theme_color: '#333',
icons: {
android: true, // Create Android home screen icon. `boolean` or `{ offset, background, mask, overlayGlow, overlayShadow }` or an array of sources
appleIcon: true, // Create Apple touch icons. `boolean` or `{ offset, background, mask, overlayGlow, overlayShadow }` or an array of sources
appleStartup: false, // Create Apple startup images. `boolean` or `{ offset, background, mask, overlayGlow, overlayShadow }` or an array of sources
coast: false, // Create Opera Coast icon. `boolean` or `{ offset, background, mask, overlayGlow, overlayShadow }` or an array of sources
favicons: true, // Create regular favicons. `boolean` or `{ offset, background, mask, overlayGlow, overlayShadow }` or an array of sources
firefox: false, // Create Firefox OS icons. `boolean` or `{ offset, background, mask, overlayGlow, overlayShadow }` or an array of sources
windows: false, // Create Windows 8 tile icons. `boolean` or `{ offset, background, mask, overlayGlow, overlayShadow }` or an array of sources
yandex: false,
},
},
}),
new MiniCssExtractPlugin({}),
],
output: {
filename: '[name].bundle.js',
path: path.resolve(__dirname, 'dist'),
clean: true,
},
optimization: {
runtimeChunk: 'single',
},
module: {
rules: [
{
test: /\.css$/,
use: [MiniCssExtractPlugin.loader, 'css-loader'],
},
{
test: /\.(png|svg|jpg|jpeg|gif)$/i,
type: 'asset/resource',
},
{
test: /\.(woff|woff2|eot|ttf|otf)$/i,
type: 'asset/resource',
},
],
},
};