-
-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathnext.config.js
More file actions
26 lines (25 loc) · 693 Bytes
/
Copy pathnext.config.js
File metadata and controls
26 lines (25 loc) · 693 Bytes
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
const { InjectManifest } = require("workbox-webpack-plugin");
const { resolve } = require("path");
module.exports = {
reactStrictMode: true,
webpack: (config, { isServer, dir }) => {
if (isServer) return config;
config.output.hotUpdateMainFilename =
config.output.hotUpdateMainFilename.replace(
"[fullhash].hot-update.json",
"[runtime].[fullhash].hot-update.json"
);
config.plugins.push(
new InjectManifest({
swSrc: resolve(dir, "src", "service-worker"),
swDest: resolve(
config.output.path,
"static",
"chunks",
"service-worker.js"
),
})
);
return config;
},
};