-
Notifications
You must be signed in to change notification settings - Fork 0
/
webpack.prod.config.js
63 lines (62 loc) · 1.59 KB
/
webpack.prod.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
const HtmlWebpackPlugin = require('html-webpack-plugin');
const WorkboxPlugin = require('workbox-webpack-plugin');
const MiniCssExtractPlugin = require('mini-css-extract-plugin');
const WebpackPwaManifest = require('webpack-pwa-manifest');
module.exports = {
entry: {
quickjots: ['./src/js/storage.js', './src/js/main.js', './src/js/listeners.js'],
},
output: {
path: __dirname + '/dist',
filename: '[name].js',
chunkFilename: '[id].[chunkhash].js',
},
plugins: [
new HtmlWebpackPlugin({
template: './src/html/index.html',
inject: true,
chunks: ['quickjots'],
filename: 'index.html',
favicon: './src/images/favicon.ico',
}),
new MiniCssExtractPlugin({
filename: '[name].css',
}),
new WorkboxPlugin.GenerateSW(),
new WebpackPwaManifest({
name: 'QuickJots',
short_name: 'QuickJots',
description: 'Jot down and auto-save any quick notes in your browser, using Markdown or plain-text',
background_color: '#ffffff',
theme_color: '#ffffff',
crossorigin: null,
icons: [
{
src: './src/images/favicon.png',
sizes: [96, 128, 192, 256, 384, 512]
},
],
}),
],
module: {
rules: [
{
test: /\.js$/,
exclude: /node_modules/,
loader: 'babel-loader',
},
{
test: /\.css$/,
use: [MiniCssExtractPlugin.loader, 'css-loader'],
},
{
test: /\.(woff|woff2)$/,
loaders: ['url-loader'],
},
{
test: /\.(png|svg|ico)$/,
use: ['file-loader'],
},
],
},
};