-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathnext.config.js
55 lines (52 loc) · 1.22 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
const removeImports = require('next-remove-imports')()
const withBundleAnalyzer = require('@next/bundle-analyzer')({
enabled: process.env.ANALYZE === 'true'
})
const withPWA = require('next-pwa')
const runtimeCaching = require('next-pwa/cache')
/** @type {import('next').NextConfig} */
const nextConfig = {
reactStrictMode: true,
webpack (config) {
config.module.rules.push({
test: /\.svg$/,
oneOf: [
{
test: /\.icon\.svg$/,
use: [{ loader: '@svgr/webpack', options: { icon: true } }]
},
{
use: [{ loader: '@svgr/webpack', options: { icon: false } }]
}
]
})
return config
},
experimental: {
outputStandalone: true
},
env: {
NEXT_PUBLIC_URL: process.env.NEXT_PUBLIC_URL
},
pwa: {
dest: 'public',
runtimeCaching,
cacheOnFrontEndNav: true,
navigateFallback: '/',
additionalManifestEntries: [
{
url: '/',
revision: String(Math.random())
}
]
},
async rewrites () {
return [
{
source: '/:date(\\d+-(?:1[012]|0[1-9])-(?:3[01]|[12][0-9]|0[1-9]))',
destination: '/'
}
]
}
}
module.exports = withBundleAnalyzer(removeImports(withPWA(nextConfig)))