-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathnext.config.mjs
More file actions
53 lines (49 loc) · 1.38 KB
/
next.config.mjs
File metadata and controls
53 lines (49 loc) · 1.38 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
/** @type {import('next').NextConfig} */
const nextConfig = {
// Enable experimental features if needed
experimental: {
// Add any experimental features here
},
// Configure webpack for WASM support
webpack: (config, { isServer }) => {
// Add WASM support
config.experiments = {
...config.experiments,
asyncWebAssembly: true,
};
// Handle .wasm files
config.module.rules.push({
test: /\.wasm$/,
type: 'webassembly/async',
});
// Fallback for Node.js modules in client-side
if (!isServer) {
config.resolve.fallback = {
...config.resolve.fallback,
fs: false,
path: false,
crypto: false,
};
}
return config;
},
// Add headers for WASM cross-origin isolation if needed
async headers() {
return [
{
source: '/(.*)',
headers: [
{
key: 'Cross-Origin-Embedder-Policy',
value: 'require-corp',
},
{
key: 'Cross-Origin-Opener-Policy',
value: 'same-origin',
},
],
},
];
},
};
export default nextConfig;