-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathnext.config.js
More file actions
63 lines (61 loc) · 1.51 KB
/
Copy pathnext.config.js
File metadata and controls
63 lines (61 loc) · 1.51 KB
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
const withBundleAnalyzer = require('@next/bundle-analyzer')({
enabled: process.env.ANALYZE === 'true',
});
module.exports = withBundleAnalyzer({
// future: {
// webpack5: true,
// }, // webpack5 is now default in Next.js 14
async redirects() {
return [
{
source: '/tags/:slug*',
destination: '/blog/tags/:slug*',
permanent: true,
},
{
source: '/tags',
destination: '/blog/tags',
permanent: true,
},
{
source: '/:slug([0-9]{4}-[0-9]{2}-[0-9]{2}.*$)',
destination: '/blog/posts/:slug',
permanent: true,
},
];
},
typescript: {
// !! WARN !!
// 一時的に型チェックをスキップします
// 本番環境では必ず修正してください
ignoreBuildErrors: true,
},
eslint: {
// !! WARN !!
// 一時的にESLintチェックをスキップします
// 本番環境では必ず修正してください
ignoreDuringBuilds: true,
},
images: {
domains: [],
},
assetPrefix: '',
webpack: (config, { isServer }) => {
if (!isServer) {
config.resolve.fallback = {
...config.resolve.fallback,
fs: false,
path: false,
punycode: false,
};
}
return config;
},
trailingSlash: false,
experimental: {
// 静的エクスポートの問題を解決するための設定
esmExternals: 'loose',
// SSRエラーを回避するための設定
serverComponentsExternalPackages: ['punycode'],
},
});