-
Notifications
You must be signed in to change notification settings - Fork 5
/
next.config.mjs
53 lines (47 loc) · 1.08 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 withPWA from 'next-pwa'
import withBundleAnalyzer from '@next/bundle-analyzer'
/** @type {import('next').NextConfig} */
const url = process.env.NEXT_PUBLIC_FIREBASE_AUTH_DOMAIN
const nextConfig = {
eslint: {
dirs: ['src']
},
reactStrictMode: true,
swcMinify: true,
experimental: {
optimizeCss: true,
appDir: false
},
rewrites: [
{
source: '/__/auth/:path*',
destination: `https://${url}/__/auth/:path*`
}
],
images: {
domains: [
'images.unsplash.com',
'storage.googleapis.com',
'localhost',
'firebasestorage.googleapis.com'
]
}
}
const PWAConfig = withPWA({
dest: 'public',
register: true,
skipWaiting: true,
disable: process.env.NODE_ENV === 'development'
})
const bundleAnalyzerConfig = withBundleAnalyzer({
enabled: process.env.ANALYZE === 'true',
openAnalyzer: false
})
const config = async ({ defaultConfig }) => {
const plugins = [PWAConfig, bundleAnalyzerConfig]
return plugins.reduce((acc, plugin) => plugin(acc), {
...defaultConfig,
...nextConfig
})
}
export default config