fix website build
This commit is contained in:
@@ -15,6 +15,11 @@ import { getAppMode, isPublicRoute } from './lib/mode';
|
||||
export function middleware(request: NextRequest) {
|
||||
const mode = getAppMode();
|
||||
const { pathname } = request.nextUrl;
|
||||
|
||||
// Always allow Next.js error routes (needed for build/prerender)
|
||||
if (pathname === '/404' || pathname === '/500' || pathname === '/_error') {
|
||||
return NextResponse.next();
|
||||
}
|
||||
|
||||
// In alpha mode, allow all routes
|
||||
if (mode === 'alpha') {
|
||||
@@ -46,6 +51,6 @@ export const config = {
|
||||
* - favicon.ico (favicon file)
|
||||
* - public folder files
|
||||
*/
|
||||
'/((?!_next/static|_next/image|favicon.ico|.*\\.(?:svg|png|jpg|jpeg|gif|webp|mp4|webm|mov|avi)$).*)',
|
||||
'/((?!_next/static|_next/image|_next/data|favicon.ico|.*\\.(?:svg|png|jpg|jpeg|gif|webp|mp4|webm|mov|avi)$).*)',
|
||||
],
|
||||
};
|
||||
Reference in New Issue
Block a user