-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathnext.config.js
More file actions
45 lines (40 loc) · 1.08 KB
/
next.config.js
File metadata and controls
45 lines (40 loc) · 1.08 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
/** @type {import('next').NextConfig} */
const nextConfig = {
images: {
domains: ['picsum.photos', 'api.yuafeng.cn', 'www.bing.com', 'bing.img.run', 'api.btstu.cn', 'api.ixiaowai.cn'],
remotePatterns: [
{
protocol: 'https',
hostname: '**',
},
],
},
async rewrites() {
return [
{
source: '/api/zhihu-hot',
destination: 'https://uapis.cn/api/v1/misc/hotboard?type=zhihu',
},
];
},
webpack: (config, { dev, isServer }) => {
// 解决开发环境下的文件监听报错
if (dev) {
config.watchOptions = {
// 忽略 node_modules、.next 和系统文件夹
// Webpack 5 的 watchOptions.ignored 仅支持 string 或 string[] (glob 模式)
ignored: [
'**/node_modules/**',
'**/.next/**',
'**/System Volume Information/**'
],
// 增加超时时间,减少扫描频率
aggregateTimeout: 600,
};
// 禁用缓存以避免缓存问题
config.cache = false;
}
return config;
},
}
module.exports = nextConfig