|
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"; |
5 | 5 |
|
6 | 6 | const withMDX = nextMDX(config);
|
7 | 7 |
|
8 | 8 | /** @type {import('next').NextConfig} */
|
9 | 9 | 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 | + }, |
38 | 41 | };
|
39 | 42 |
|
40 | 43 | export default async function () {
|
41 |
| - return withMDX(nextConfig); |
| 44 | + return withMDX(nextConfig); |
42 | 45 | }
|
0 commit comments