SurfSense/surfsense_web/next.config.ts

61 lines
1.5 KiB
TypeScript
Raw Normal View History

2025-07-27 10:05:37 -07:00
import { createMDX } from "fumadocs-mdx/next";
import type { NextConfig } from "next";
import createNextIntlPlugin from "next-intl/plugin";
// Create the next-intl plugin
const withNextIntl = createNextIntlPlugin("./i18n/request.ts");
2025-04-07 23:47:06 -07:00
const nextConfig: NextConfig = {
output: "standalone",
2025-11-23 15:23:31 +05:30
// Disable StrictMode for BlockNote compatibility with React 19/Next 15
reactStrictMode: false,
2025-07-27 10:05:37 -07:00
typescript: {
ignoreBuildErrors: true,
},
images: {
remotePatterns: [
{
protocol: "https",
2025-08-23 19:40:29 -07:00
hostname: "**",
},
],
},
2025-11-23 15:23:31 +05:30
// Mark BlockNote server packages as external
2025-11-23 16:39:23 +05:30
serverExternalPackages: ["@blocknote/server-util"],
2025-11-23 15:23:31 +05:30
// Configure webpack to handle blocknote packages
webpack: (config, { isServer }) => {
if (isServer) {
// Don't bundle these packages on the server
2025-11-23 16:39:23 +05:30
config.externals = [...(config.externals || []), "@blocknote/server-util"];
2025-11-23 15:23:31 +05:30
}
return config;
},
// PostHog reverse proxy configuration
// This helps bypass ad blockers by routing requests through your domain
async rewrites() {
return [
{
source: "/ingest/static/:path*",
destination: "https://us-assets.i.posthog.com/static/:path*",
},
{
source: "/ingest/:path*",
destination: "https://us.i.posthog.com/:path*",
},
{
source: "/ingest/decide",
destination: "https://us.i.posthog.com/decide",
},
];
},
// Required for PostHog reverse proxy to work correctly
skipTrailingSlashRedirect: true,
2025-04-07 23:47:06 -07:00
};
// Wrap the config with MDX and next-intl plugins
2025-04-22 02:24:13 -07:00
const withMDX = createMDX({});
export default withNextIntl(withMDX(nextConfig));