This repository was archived by the owner on Mar 8, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathnext.config.mjs
129 lines (125 loc) · 3.21 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
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
121
122
123
124
125
126
127
128
129
import withPWAInit from '@ducanh2912/next-pwa'
import { withSentryConfig } from '@sentry/nextjs'
import nextra from 'nextra'
const withNextra = nextra({
theme: 'nextra-theme-docs',
themeConfig: './config/theme.config.tsx',
flexsearch: true,
defaultShowCopyCode: true
})
const withPWA = withPWAInit({
dest: 'public',
register: true,
skipWaiting: true,
disable: process.env.NODE_ENV === 'development',
workboxOptions: {
maximumFileSizeToCacheInBytes: 20000000
}
})
/** @type {import("next").NextConfig} */
const nextConfig = withNextra(
withPWA({
swcMinify: true,
reactStrictMode: true,
async redirects() {
return [
{
source: '/group-hr',
destination: 'https://www.facebook.com/groups/xomhr',
permanent: true
},
{
source: '/group-dev',
destination: 'https://www.facebook.com/groups/2827248757496356',
permanent: true
},
{
source: '/group-design',
destination: 'https://www.facebook.com/groups/1868252066694465',
permanent: true
},
{
source: '/blog',
destination: 'https://blog.hrpenci.site',
permanent: true
},
{
source: '/blog/khai-niem-giua-back-end-va-front-end',
destination:
'https://blog.hrpenci.site/posts/khai-niem-giua-back-end-va-front-end-phan-1/',
permanent: true
},
{
source: '/bookmarks',
destination: 'https://blog.hrpenci.site/posts/bookmarks/',
permanent: true
},
{
source: '/docs/front-end/:slug*',
destination: '/docs/hr/front-end/:slug*',
permanent: true
},
{
source: '/docs/back-end/:slug*',
destination: '/docs/hr/back-end/:slug*',
permanent: true
},
{
source: '/docs/linux/:slug*',
destination: '/docs/hr/linux/:slug*',
permanent: true
},
{
source: '/docs/design/:slug*',
destination: '/docs/hr/design/:slug*',
permanent: true
},
{
source: '/docs/nang-cao/:slug*',
destination: 'https://hrpenci.site',
permanent: true
}
]
},
images: {
formats: ['image/webp'],
remotePatterns: [
{
protocol: 'https',
hostname: '**.imagekit.io'
}
],
loader: 'custom',
loaderFile: './imagekitLoader.js'
},
webpack: (config, { dev, isServer }) => {
if (!dev && !isServer) {
Object.assign(config.resolve.alias, {
'react/jsx-runtime.js': 'preact/compat/jsx-runtime',
react: 'preact/compat',
'react-dom/test-utils': 'preact/test-utils',
'react-dom': 'preact/compat'
})
}
config.module.rules.push({
test: /\.svg$/,
use: ['@svgr/webpack']
})
return config
}
})
)
export default withSentryConfig(
nextConfig,
{
org: process.env.SENTRY_ORG,
project: process.env.SENTRY_PROJECT,
dist: '1'
},
{
widenClientFileUpload: true,
transpileClientSDK: true,
hideSourceMaps: true,
disableLogger: true
}
)