-
Notifications
You must be signed in to change notification settings - Fork 0
/
next.config.js
executable file
·82 lines (74 loc) · 1.93 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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
// const webpack = require('webpack')
// next-plugins
// const withPlugins = require('next-compose-plugins')
// const withPWA = require('next-pwa')({
// dest: 'public',
// })
const withBundleAnalyzer = require('@next/bundle-analyzer')({
enabled: process.env.ANALYZE === 'true',
})
// next-plugins end
// if move pwa config to witPlugins, it will not work
/** @type {import('next').NextConfig} */
const nextConfig = {
// transpilePackages: ['ramda'],
compiler: {
// see https://styled-components.com/docs/tooling#babel-plugin for more info on the options.
styledComponents: true,
},
// only in dev
// see https://nextjs.org/docs/pages/building-your-application/rendering
// https://github.com/vercel/next.js/issues/35822
reactStrictMode: true,
swcMinify: true,
productionBrowserSourceMaps: true,
experimental: {
reactCompiler: true,
scrollRestoration: true,
optimizePackageImports: ['ramda'],
// for fix build error for useSearchParams
missingSuspenseWithCSRBailout: false,
},
async headers() {
return [
{
source: '/',
headers: [
{
key: 'cache-control',
value: 's-maxage=600, stale-while-revalidate=30',
},
],
},
{
source: '/pricing',
headers: [
{
key: 'cache-control',
value: 's-maxage=600, stale-while-revalidate=30',
},
],
},
{
source: '/book-demo',
headers: [
{
key: 'cache-control',
value: 's-maxage=600, stale-while-revalidate=30',
},
],
},
{
source: '/oops',
headers: [
{
key: 'cache-control',
value: 's-maxage=6000, stale-while-revalidate=30',
},
],
},
]
},
}
// module.exports = withBundleAnalyzer(withPWA(nextConfig))
module.exports = withBundleAnalyzer(nextConfig)