-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathnext.config.js
More file actions
64 lines (58 loc) · 1.41 KB
/
next.config.js
File metadata and controls
64 lines (58 loc) · 1.41 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
64
/** @type {import('next').NextConfig} */
const nextConfig = {
experimental: {
serverActions: {
allowedOrigins: ['localhost:3000', 'vercel.app', '*.vercel.app']
}
},
// WebSocket support for external integrations
webpack: (config, { isServer }) => {
config.externals.push({
'node:buffer': 'commonjs buffer'
});
// Ignore markdown files in node_modules
config.module.rules.push({
test: /\.md$/,
loader: 'ignore-loader'
});
// Handle native modules
config.module.rules.push({
test: /\.node$/,
loader: 'node-loader'
});
// Additional fixes for libsql package
if (!isServer) {
config.resolve.fallback = {
...config.resolve.fallback,
fs: false,
net: false,
tls: false,
crypto: false,
};
}
// Externalize problematic modules for server-side
if (isServer) {
config.externals.push('libsql', '@libsql/client');
}
return config;
},
// Support for loading VRM models and assets
async headers() {
return [
{
source: '/(.*)',
headers: [
{
key: 'Cross-Origin-Embedder-Policy',
value: 'unsafe-none',
},
{
key: 'Cross-Origin-Opener-Policy',
value: 'same-origin-allow-popups',
},
],
},
];
},
};
module.exports = nextConfig;