Fix: Move legacy asset rewrite to next.config.mjs beforeFiles for Next.js standalone compat
All checks were successful
All checks were successful
This commit is contained in:
@@ -47,7 +47,8 @@ export function middleware(request: NextRequest) {
|
||||
const targetPath = remainingPath.startsWith(`assets/${directory}/`)
|
||||
? `/${remainingPath}`
|
||||
: `/assets/${directory}/${remainingPath}`;
|
||||
|
||||
|
||||
console.log(`[Middleware] Rewriting to: /showcase/${directory}${targetPath}`);
|
||||
return NextResponse.rewrite(new URL(`/showcase/${directory}${targetPath}`, request.url));
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user