68 lines
1.6 KiB
TypeScript
68 lines
1.6 KiB
TypeScript
import type { NextConfig } from "next";
|
|
import createNextIntlPlugin from "next-intl/plugin";
|
|
import createMDX from "@next/mdx";
|
|
|
|
const withNextIntl = createNextIntlPlugin("./src/i18n/request.ts");
|
|
const withMDX = createMDX({
|
|
extension: /\.mdx?$/,
|
|
});
|
|
|
|
const nextConfig: NextConfig = {
|
|
pageExtensions: ["js", "jsx", "md", "mdx", "ts", "tsx"],
|
|
serverExternalPackages: ["@prisma/client", ".prisma/client", "sharp", "pg", "@prisma/adapter-pg"],
|
|
reactCompiler: true,
|
|
// Configure webpack for raw imports
|
|
webpack: (config) => {
|
|
config.module.rules.push({
|
|
resourceQuery: /raw/,
|
|
type: 'asset/source',
|
|
});
|
|
return config;
|
|
},
|
|
// Experimental features
|
|
experimental: {
|
|
// Enable server actions
|
|
serverActions: {
|
|
bodySizeLimit: "2mb",
|
|
},
|
|
},
|
|
// Image optimization
|
|
images: {
|
|
unoptimized: true,
|
|
remotePatterns: [
|
|
{
|
|
protocol: "https",
|
|
hostname: "**",
|
|
},
|
|
],
|
|
},
|
|
// Redirects
|
|
async redirects() {
|
|
return [
|
|
{
|
|
source: "/vibe",
|
|
destination: "/categories/vibe",
|
|
permanent: true,
|
|
},
|
|
{
|
|
source: "/sponsors",
|
|
destination: "/categories/sponsors",
|
|
permanent: true,
|
|
},
|
|
{
|
|
source: "/embed-preview",
|
|
destination: "/embed",
|
|
permanent: true,
|
|
},
|
|
// Redirect book PDF downloads to GitHub raw to save Vercel edge bandwidth
|
|
{
|
|
source: "/book-pdf/:filename",
|
|
destination: "https://raw.githubusercontent.com/f/prompts.chat/refs/heads/main/public/book-pdf/:filename",
|
|
permanent: false,
|
|
},
|
|
];
|
|
},
|
|
};
|
|
|
|
export default withMDX(withNextIntl(nextConfig));
|