fix: rybbit blocking using next rewrite

This commit is contained in:
gosangam
2026-06-07 00:52:49 +05:30
parent bcffe9684f
commit d5fb350652
2 changed files with 25 additions and 13 deletions
+11 -11
View File
@@ -77,18 +77,18 @@ export default function RootLayout({
<AuthProvider> <AuthProvider>
<NotificationsProvider> <NotificationsProvider>
<AuthGateProvider> <AuthGateProvider>
<AudioPlayerProvider> <AudioPlayerProvider>
<TooltipProvider> <TooltipProvider>
<SharePostProvider> <SharePostProvider>
{children} {children}
{/* Toaster and FloatingPlayer are global — toasts and {/* Toaster and FloatingPlayer are global — toasts and
currently-playing audio survive navigation between currently-playing audio survive navigation between
route groups. */} route groups. */}
<FloatingPlayer /> <FloatingPlayer />
<Toaster /> <Toaster />
</SharePostProvider> </SharePostProvider>
</TooltipProvider> </TooltipProvider>
</AudioPlayerProvider> </AudioPlayerProvider>
</AuthGateProvider> </AuthGateProvider>
</NotificationsProvider> </NotificationsProvider>
</AuthProvider> </AuthProvider>
@@ -97,7 +97,7 @@ export default function RootLayout({
next/script's defer-equivalent). Site-wide via the root layout, next/script's defer-equivalent). Site-wide via the root layout,
loaded once across navigations. */} loaded once across navigations. */}
<Script <Script
src="https://analytics.krispire.cloud/api/script.js" src="/api/script.js"
data-site-id="1" data-site-id="1"
strategy="afterInteractive" strategy="afterInteractive"
/> />
+14 -2
View File
@@ -3,8 +3,20 @@ import type { NextConfig } from "next";
const nextConfig: NextConfig = { const nextConfig: NextConfig = {
/* config options here */ /* config options here */
turbopack: { turbopack: {
root: "/" root: "/",
} },
async rewrites() {
return [
{
source: "/api/script.js",
destination: `${process.env.NEXT_PUBLIC_RYBBIT_HOST}/api/script.js`,
},
{
source: "/api/track",
destination: `${process.env.NEXT_PUBLIC_RYBBIT_HOST}/api/track`,
},
];
},
}; };
export default nextConfig; export default nextConfig;