-
Notifications
You must be signed in to change notification settings - Fork 0
/
next.config.js
33 lines (30 loc) · 927 Bytes
/
next.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
const {
PHASE_DEVELOPMENT_SERVER,
PHASE_PRODUCTION_BUILD,
} = require("next/constants");
/** @type {(phase: string, defaultConfig: import("next").NextConfig) => Promise<import("next").NextConfig>} */
module.exports = async (phase) => {
/** @type {import("next").NextConfig} */
const nextConfig = {
images: {
remotePatterns: [
{
protocol: "https",
hostname: "lh3.googleusercontent.com",
port: "",
pathname: "**",
},
],
},
};
if (phase === PHASE_DEVELOPMENT_SERVER || phase === PHASE_PRODUCTION_BUILD) {
const withSerwist = (await import("@serwist/next")).default({
// Note: This is only an example. If you use Pages Router,
// use something else that works, such as "service-worker/index.ts".
swSrc: "app/sw.js",
swDest: "public/sw.js",
});
return withSerwist(nextConfig);
}
return nextConfig;
};