-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathnext.config.js
More file actions
46 lines (40 loc) · 1015 Bytes
/
next.config.js
File metadata and controls
46 lines (40 loc) · 1015 Bytes
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
const { ANALYZE, NEXT_PUBLIC_ALLOWED_ASSET_DOMAINS } = process.env;
// analyze
// <distDir>/analyze/
const withBundleAnalyzer = require('@next/bundle-analyzer')({
enabled: ANALYZE === 'true',
});
const nextConfig = {
// @see https://nextjs.org/docs/messages/next-image-unconfigured-host
images: {
domains: NEXT_PUBLIC_ALLOWED_ASSET_DOMAINS.split(','),
},
swcMinify: true,
experimental: {
swcLoader: true,
cpus: 4,
},
webpack: (config, { isServer }) => {
// エラーを抑制
if (!isServer) {
// eslint-disable-next-line no-param-reassign
config.resolve.fallback = {
...config.resolve.fallback,
...{
fs: false,
path: false,
child_process: false,
worker_threads: false,
net: false,
dns: false,
tls: false,
crypto: false,
os: false,
tty: false,
},
};
}
return config;
},
};
module.exports = withBundleAnalyzer(nextConfig);