-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathwebpack.config.js
87 lines (83 loc) · 2.11 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
78
79
80
81
82
83
84
85
86
87
const WebpackPwaManifest = require("webpack-pwa-manifest");
const WorkboxWebpackPlugin = require("workbox-webpack-plugin");
const path = require("path");
/**
* Webpack Config
* @see https://webpack.js.org/concepts/configuration/
*/
const config = {
entry: "./public/assets/js/signup.js",
output: {
path: __dirname + "/public/dist",
filename: "bundle.js",
},
mode: "development",
plugins: [
new WebpackPwaManifest({
publicPath: "/dist/",
filename: "manifest.webmanifest",
inject: false,
fingerprints: false,
name: "Docket Master",
short_name: "Docket Master",
theme_color: "#333333",
background_color: "#ffffff",
start_url: "/",
display: "standalone",
icons: [
{
src: path.resolve(__dirname, "public/assets/img/favicon/scales-icon.png"),
size: [72, 96, 128, 144, 152, 192, 384, 512],
},
],
}),
new WorkboxWebpackPlugin.GenerateSW({
swDest: "../service-worker.js",
clientsClaim: true,
skipWaiting: true,
exclude: [
/\.(?:png|jpb|jpeg|svg)$/,
/\.map$/,
/manifest\.webmanifest$/,
/bundle\.js/,
/service-worker\.js$/,
/sw\.js$/,
],
runtimeCaching: [
{
urlPattern: "/.(?:html|htm|xml)$/",
handler: "StaleWhileRevalidate",
options: {
cacheName: "markup",
expiration: {
maxAgeSeconds: 31536000,
},
},
},
{
urlPattern: "/.(?css|js)$/",
handler: "StaleWhileRevalidate",
options: {
cacheName: "assets",
expiration: {
maxEntries: "500",
maxAgeSeconds: 31536000,
},
},
},
{
urlPattern: "/.(?png|jpg|jpeg|gif|bmp|webp|svg|ico)$/",
handler: "CacheFirst",
options: {
cacheName: "images",
expiration: {
maxEntries: "500",
maxAgeSeconds: 31536000,
},
},
},
],
}),
],
};
module.exports = config;