-
Notifications
You must be signed in to change notification settings - Fork 1
/
next.config.mjs
53 lines (51 loc) · 1.51 KB
/
next.config.mjs
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
import runtimeCaching from 'next-pwa/cache.js'
import withPWA from 'next-pwa'
import withPlaiceholder from '@plaiceholder/next'
import withBundleAnalyzer from '@next/bundle-analyzer'
// eslint-disable-next-line import/no-anonymous-default-export
export default (phase, { defaultConfig }) => {
/**
* @type {import('next').NextConfig}
*/
const nextConfig = {
reactStrictMode: true,
output: 'export',
trailingSlash: true,
reactStrictMode: true,
swcMinify: true,
images: {
formats: ['image/avif', 'image/webp'],
loader: 'custom',
loaderFile: './src/constant/images.ts',
remotePatterns: [
{
protocol: 'https',
hostname: 'ik.imagekit.io/jerensl/**',
port: '',
},
],
},
compiler: {
removeConsole: process.env.NODE_ENV !== 'development',
},
}
const plugins = [
withPWA({
dest: 'public',
disable: process.env.NODE_ENV === 'development',
register: true,
skipWaiting: true,
customWorkerDir: 'src/worker',
runtimeCaching,
cacheOnFrontEndNav: true,
}),
withBundleAnalyzer({
enabled: process.env.ANALYZE === 'true',
}),
withPlaiceholder,
]
const config = plugins.reduce((acc, next) => next(acc), {
...nextConfig,
})
return config
}