-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathnext.config.js
44 lines (43 loc) · 1.9 KB
/
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
34
35
36
37
38
39
40
41
42
43
44
/** @type {import('next').NextConfig} */
const withPWA = require('next-pwa')
module.exports = (phase, { defaultConfig }) => {
if (phase === 'phase-development-server') {
return {
reactStrictMode: true,
swcMinify: true,
}
} else {
return withPWA({
pwa: {
dest: 'public',
swSrc: 'service-worker.js',
},
reactStrictMode: true,
swcMinify: true,
basePath: phase === 'phase-export' && process.env.STAGING === 'true' ? '/huffmanks/out' : '',
// experimental: {
// images: {
// unoptimized: true,
// },
// },
...(phase === 'phase-export' &&
process.env.STAGING === 'true' && {
exportPathMap: async function (defaultPathMap, { dev, dir, outDir, distDir, buildId }) {
return {
'/': { page: '/' },
'/calculate/aspect-ratio/index': { page: '/calculate/aspect-ratio' },
'/calculate/units/index': { page: '/calculate/units' },
'/format/text/index': { page: '/format/text' },
'/generate/email-signature/index': { page: '/generate/email-signature' },
'/generate/password/index': { page: '/generate/password' },
'/generate/qr-code/index': { page: '/generate/qr-code' },
'/generate/todo/index': { page: '/generate/todo' },
'/picker/color/index': { page: '/picker/color' },
'/picker/item/index': { page: '/picker/item' },
'/picker/number/index': { page: '/picker/number' },
}
},
}),
})
}
}