mirror of
https://github.com/theoludwig/theoludwig.git
synced 2025-09-11 23:09:22 +02:00
perf!: monorepo setup + fully static + webp images
BREAKING CHANGE: minimum supported Node.js >= 22.0.0 and pnpm >= 9.5.0
This commit is contained in:
23
apps/website/middleware.ts
Normal file
23
apps/website/middleware.ts
Normal file
@@ -0,0 +1,23 @@
|
||||
import { LOCALES, LOCALE_DEFAULT, LOCALE_PREFIX } from "@repo/i18n/config"
|
||||
import createMiddleware from "next-intl/middleware"
|
||||
|
||||
export default createMiddleware({
|
||||
locales: LOCALES,
|
||||
defaultLocale: LOCALE_DEFAULT,
|
||||
localePrefix: LOCALE_PREFIX,
|
||||
})
|
||||
|
||||
export const config = {
|
||||
matcher: [
|
||||
// Enable a redirect to a matching locale at the root
|
||||
"/",
|
||||
|
||||
// Set a cookie to remember the previous locale for
|
||||
// all requests that have a locale prefix
|
||||
"/(en-US|fr-FR)/:path*",
|
||||
|
||||
// Enable redirects that add missing locales
|
||||
// (e.g. `/pathnames` -> `/en/pathnames`)
|
||||
"/((?!_next|_vercel|.*\\..*).*)",
|
||||
],
|
||||
}
|
Reference in New Issue
Block a user