mirror of
https://github.com/MODSetter/SurfSense.git
synced 2026-04-25 08:46:22 +02:00
- Updated PostHog initialization to use a reverse proxy for API requests. - Added rewrites in Next.js configuration to route requests through the domain. - Set ui_host for proper toolbar functionality and ensured correct pageview tracking.
60 lines
1.5 KiB
TypeScript
60 lines
1.5 KiB
TypeScript
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");
|
|
|
|
const nextConfig: NextConfig = {
|
|
output: "standalone",
|
|
// Disable StrictMode for BlockNote compatibility with React 19/Next 15
|
|
reactStrictMode: false,
|
|
typescript: {
|
|
ignoreBuildErrors: true,
|
|
},
|
|
images: {
|
|
remotePatterns: [
|
|
{
|
|
protocol: "https",
|
|
hostname: "**",
|
|
},
|
|
],
|
|
},
|
|
// Mark BlockNote server packages as external
|
|
serverExternalPackages: ["@blocknote/server-util"],
|
|
|
|
// Configure webpack to handle blocknote packages
|
|
webpack: (config, { isServer }) => {
|
|
if (isServer) {
|
|
// Don't bundle these packages on the server
|
|
config.externals = [...(config.externals || []), "@blocknote/server-util"];
|
|
}
|
|
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,
|
|
};
|
|
|
|
// Wrap the config with MDX and next-intl plugins
|
|
const withMDX = createMDX({});
|
|
|
|
export default withNextIntl(withMDX(nextConfig));
|