-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathnext.config.mjs
More file actions
63 lines (57 loc) · 1.91 KB
/
Copy pathnext.config.mjs
File metadata and controls
63 lines (57 loc) · 1.91 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
/** @type {import('next').NextConfig} */
import path from 'path';
import { fileURLToPath } from 'url';
const __dirname = path.dirname(fileURLToPath(import.meta.url));
const nextConfig = {
// Pin the workspace root so Next 15 doesn't infer a stray parent-dir
// lockfile as the root (breaks output file tracing on deploy).
outputFileTracingRoot: __dirname,
experimental: {
optimizePackageImports: ["@chakra-ui/react"],
},
// Next 15: renamed from experimental.serverComponentsExternalPackages.
serverExternalPackages: [
'@stellar/stellar-sdk',
'@stellar/stellar-sdk-v14',
'@stellar/stellar-base',
'sodium-native'
],
transpilePackages: [
'passkey-kit',
'passkey-factory-sdk',
'passkey-kit-sdk',
'sac-sdk',
'@soroban-react/core',
'@soroban-react/types',
'react-social-icons',
],
webpack: (config, { isServer }) => {
if (!isServer) {
// ✅ Prevent client-side bundling
config.resolve.fallback = {
...config.resolve.fallback,
fs: false,
crypto: false,
stream: false,
buffer: false,
};
}
// Fix: passkey-kit bundles @stellar/stellar-sdk@14 which requires
// lib/package.json that pnpm deduplication removes. Redirect it to
// the actual root package.json of the same package.
const missingPkgJson = path.join(
__dirname,
'node_modules/passkey-kit/node_modules/@stellar/stellar-sdk/lib/package.json'
);
const actualPkgJson = path.join(
__dirname,
'node_modules/passkey-kit/node_modules/@stellar/stellar-sdk/package.json'
);
config.resolve.alias = {
...config.resolve.alias,
[missingPkgJson]: actualPkgJson,
};
return config;
},
};
export default nextConfig;