Skip to content

Commit 2122969

Browse files
committed
chore: fix vercel routing (#2760)
<!-- Please make sure there is an issue that this PR is correlated to. --> ## Changes <!-- If there are frontend changes, please include screenshots. -->
1 parent 6cfd757 commit 2122969

File tree

1 file changed

+36
-33
lines changed

1 file changed

+36
-33
lines changed

site/next.config.ts

Lines changed: 36 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -1,42 +1,45 @@
1-
import path from 'node:path';
2-
import url from 'node:url';
3-
import nextMDX from '@next/mdx';
4-
import { config } from './src/mdx/mdx';
1+
import path from "node:path";
2+
import url from "node:url";
3+
import nextMDX from "@next/mdx";
4+
import { config } from "./src/mdx/mdx";
55

66
const withMDX = nextMDX(config);
77

88
/** @type {import('next').NextConfig} */
99
const nextConfig = {
10-
output: 'export',
11-
trailingSlash: false,
12-
reactStrictMode: true,
13-
transpilePackages: ['@rivet-gg/components', '@rivet-gg/icons'],
14-
typescript: {
15-
ignoreBuildErrors: true
16-
},
17-
pageExtensions: ['js', 'jsx', 'ts', 'tsx', 'mdx', 'md'],
18-
images: {
19-
// For static output
20-
unoptimized: true
21-
},
22-
experimental: {
23-
scrollRestoration: true
24-
},
25-
webpack: config => {
26-
const __dirname = path.dirname(url.fileURLToPath(import.meta.url));
27-
return {
28-
...config,
29-
resolve: {
30-
...config.resolve,
31-
fallback: {
32-
'react/jsx-dev-runtime': path.resolve(__dirname, '../node_modules/react/jsx-dev-runtime.js'),
33-
react: path.resolve(__dirname, '../node_modules/react')
34-
}
35-
}
36-
};
37-
}
10+
output: "export",
11+
trailingSlash: true, // Required for Vercel
12+
reactStrictMode: true,
13+
transpilePackages: ["@rivet-gg/components", "@rivet-gg/icons"],
14+
typescript: {
15+
ignoreBuildErrors: true,
16+
},
17+
pageExtensions: ["js", "jsx", "ts", "tsx", "mdx", "md"],
18+
images: {
19+
// For static output
20+
unoptimized: true,
21+
},
22+
experimental: {
23+
scrollRestoration: true,
24+
},
25+
webpack: (config) => {
26+
const __dirname = path.dirname(url.fileURLToPath(import.meta.url));
27+
return {
28+
...config,
29+
resolve: {
30+
...config.resolve,
31+
fallback: {
32+
"react/jsx-dev-runtime": path.resolve(
33+
__dirname,
34+
"../node_modules/react/jsx-dev-runtime.js",
35+
),
36+
react: path.resolve(__dirname, "../node_modules/react"),
37+
},
38+
},
39+
};
40+
},
3841
};
3942

4043
export default async function () {
41-
return withMDX(nextConfig);
44+
return withMDX(nextConfig);
4245
}

0 commit comments

Comments
 (0)