-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathnext.config.js
120 lines (118 loc) · 3.2 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
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
/* eslint-disable @typescript-eslint/no-var-requires */
var { withSentryConfig } = require('@sentry/nextjs')
const ForkTsCheckerWebpackPlugin = require('fork-ts-checker-webpack-plugin')
const withPWA = require('next-pwa')
const runtimeCaching = require('next-pwa/cache')
module.exports = withPWA({
disable: process.env.NODE_ENV === 'development',
dest: 'public',
publicExcludes: ['!rss/*', '!sitemap.xml', '!sitemap-*.xml'],
register: true,
skipWaiting: true,
cacheOnFrontEndNav: true,
runtimeCaching,
})(
withSentryConfig(
{
reactStrictMode: true,
experimental: {
forceSwcTransforms: true,
amp: {
skipValidation: true,
},
},
images: {
domains: ['webring.xxiivv.com'],
dangerouslyAllowSVG: true,
contentSecurityPolicy:
"default-src 'self'; script-src 'none'; sandbox;",
},
i18n: {
locales: ['en', 'ru'],
defaultLocale: 'ru',
},
async redirects() {
return [
{
source: '/post/:slug',
destination: '/posts/:slug',
permanent: true,
},
{
source: '/blog/:slug',
destination: '/posts/:slug',
permanent: true,
},
{
source: '/blog',
destination: '/posts',
permanent: true,
},
{
source: '/music',
destination: '/creativity',
permanent: true,
},
{
source: '/creation',
destination: '/creativity',
permanent: true,
},
{
source: '/creation/:slug',
destination: '/creativity/:slug',
permanent: true,
},
{
source: '/assets/creation/:path*',
destination: '/assets/creativity/:path*',
permanent: true,
},
{
source: '/rss/creation/feed.xml',
destination: '/rss/ru/creativity/feed.xml',
permanent: true,
},
{
source: '/rss/posts/feed.xml',
destination: '/rss/ru/posts/feed.xml',
permanent: true,
},
{
source: '/rss/creation/feed.json',
destination: '/rss/ru/creativity/feed.json',
permanent: true,
},
{
source: '/rss/posts/feed.json',
destination: '/rss/ru/posts/feed.json',
permanent: true,
},
]
},
webpack: (config, { dev, isServer }) => {
if (dev && !isServer) {
config.plugins.push(new ForkTsCheckerWebpackPlugin())
}
config.resolve.fallback = {
...config.resolve.fallback,
fs: false,
}
return config
},
serverRuntimeConfig: {
GA_CODE: process.env.NEXT_PUBLIC_GA_CODE,
YM_CODE: process.env.NEXT_PUBLIC_YM_CODE,
HOST: process.env.NEXT_PUBLIC_HOST,
},
publicRuntimeConfig: {
GA_CODE: process.env.NEXT_PUBLIC_GA_CODE,
YM_CODE: process.env.NEXT_PUBLIC_YM_CODE,
HOST: process.env.NEXT_PUBLIC_HOST,
},
},
{
silent: true,
},
),
)