-
Notifications
You must be signed in to change notification settings - Fork 7
Expand file tree
/
Copy pathnext.config.ts
More file actions
40 lines (35 loc) · 892 Bytes
/
Copy pathnext.config.ts
File metadata and controls
40 lines (35 loc) · 892 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
import type { NextConfig } from "next"
import createNextIntlPlugin from "next-intl/plugin"
const withNextIntl = createNextIntlPlugin("./i18n/request.ts")
const nextConfig: NextConfig = {
// Turbopack 配置(Next.js 16 默认使用)
turbopack: {},
// Webpack 配置(用于 Web Worker 支持)
webpack: (config, { isServer }) => {
if (!isServer) {
// 确保 WASM 文件正确加载
config.resolve.fallback = {
...config.resolve.fallback,
fs: false,
path: false,
crypto: false,
}
}
return config
},
// 静态文件配置
async headers() {
return [
{
source: "/models/:path*",
headers: [
{
key: "Cache-Control",
value: "public, max-age=31536000, immutable",
},
],
},
]
},
}
export default withNextIntl(nextConfig)