-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathnext.config.ts
58 lines (56 loc) · 1.53 KB
/
next.config.ts
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
54
55
56
57
58
import type { NextConfig } from 'next'
import withBundleAnalyzer from '@next/bundle-analyzer'
import withPlugins from 'next-compose-plugins'
import { DEFAULT_HOMEPAGE_URL } from '@/constants'
import { webpack } from 'next/dist/compiled/webpack/webpack'
import { name, version } from './package.json'
const nextConfig: NextConfig = withPlugins([[withBundleAnalyzer({ enabled: false })]], {
env: {
packageName: name,
packageVersion: version,
},
reactStrictMode: true,
logging: {
fetches: {
fullUrl: true,
hmrRefreshes: true,
},
},
experimental: {
// reactCompiler: {
// compilationMode: "annotation",
// },
},
async rewrites() {
return [
{ source: '/', destination: DEFAULT_HOMEPAGE_URL },
{ source: '/healthz', destination: '/api/health' },
]
},
output: 'standalone',
webpack: (config: webpack.Configuration, { isServer }: { isServer: boolean }) => {
if (!isServer) {
config.resolve = {
...config.resolve,
fallback: {
// fixes @nats-io/transport-node dependencies
net: false,
dns: false,
tls: false,
fs: false,
// assert: false,
// path: false,
// events: false,
// process: false,
},
} as webpack.ResolveOptions
}
config.plugins?.push(
new webpack.NormalModuleReplacementPlugin(/node:/, (resource: any) => {
resource.request = resource.request.replace(/^node:/, '')
})
)
return config
},
})
export default nextConfig