a tool for shared writing and social publishing
1// @ts-check 2 3/** @type {import('next').NextConfig} */ 4const nextConfig = { 5 turbopack: { 6 resolveExtensions: [".mdx", ".tsx", ".ts", ".jsx", ".js", ".mjs", ".json"], 7 }, 8 allowedDevOrigins: ["localhost", "127.0.0.1"], 9 webpack: (config) => { 10 config.resolve.extensionAlias = { 11 ".js": [".ts", ".tsx", ".js"], 12 }; 13 14 return config; 15 }, 16 async rewrites() { 17 return [ 18 { 19 source: "/potluck", 20 destination: "/template/5465909f-7a19-4873-b796-0c6be3ec9f04", 21 }, 22 ]; 23 }, 24 serverExternalPackages: ["yjs", "pino"], 25 pageExtensions: ["js", "jsx", "ts", "tsx", "md", "mdx"], 26 images: { 27 loader: "custom", 28 loaderFile: "./supabase/supabase-image-loader.js", 29 remotePatterns: [ 30 { protocol: "http", hostname: "127.0.0.1", port: "54321" }, 31 { protocol: "https", hostname: "bdefzwcumgzjwllsnaej.supabase.co" }, 32 ], 33 }, 34 reactCompiler: true, 35 experimental: { 36 serverActions: { 37 bodySizeLimit: "5mb", 38 }, 39 staleTimes: { 40 dynamic: 600, 41 static: 600, 42 }, 43 }, 44}; 45 46const withMDX = require("@next/mdx")({ 47 extension: /\.mdx?$/, 48}); 49const withBundleAnalyzer = require("@next/bundle-analyzer")({ 50 enabled: process.env.ANALYZE === "true", 51}); 52module.exports = withBundleAnalyzer(withMDX(nextConfig));