76504ebae3
This makes sure custom-routes function properly with i18n support. Since the `locale` is stripped from the `pathname` this re-adds when checking custom-routes to allow the locale to be matched against Closes: https://github.com/vercel/next.js/issues/18349
89 lines
1.8 KiB
JavaScript
89 lines
1.8 KiB
JavaScript
module.exports = {
|
|
// target: 'experimental-serverless-trace',
|
|
i18n: {
|
|
locales: ['nl-NL', 'nl-BE', 'nl', 'fr-BE', 'fr', 'en-US', 'en'],
|
|
defaultLocale: 'en-US',
|
|
domains: [
|
|
{
|
|
// used for testing, this should not be needed in most cases
|
|
// as production domains should always use https
|
|
http: true,
|
|
domain: 'example.be',
|
|
defaultLocale: 'nl-BE',
|
|
locales: ['nl', 'nl-NL', 'nl-BE'],
|
|
},
|
|
{
|
|
http: true,
|
|
domain: 'example.fr',
|
|
defaultLocale: 'fr',
|
|
locales: ['fr-BE'],
|
|
},
|
|
],
|
|
},
|
|
async redirects() {
|
|
return [
|
|
{
|
|
source: '/en-US/redirect',
|
|
destination: '/somewhere-else',
|
|
permanent: false,
|
|
},
|
|
{
|
|
source: '/nl/redirect',
|
|
destination: '/somewhere-else',
|
|
permanent: false,
|
|
},
|
|
{
|
|
source: '/redirect',
|
|
destination: '/somewhere-else',
|
|
permanent: false,
|
|
},
|
|
]
|
|
},
|
|
async rewrites() {
|
|
return [
|
|
{
|
|
source: '/en-US/rewrite',
|
|
destination: '/another',
|
|
},
|
|
{
|
|
source: '/nl/rewrite',
|
|
destination: '/another',
|
|
},
|
|
{
|
|
source: '/rewrite',
|
|
destination: '/another',
|
|
},
|
|
]
|
|
},
|
|
async headers() {
|
|
return [
|
|
{
|
|
source: '/en-US/add-header',
|
|
headers: [
|
|
{
|
|
key: 'x-hello',
|
|
value: 'world',
|
|
},
|
|
],
|
|
},
|
|
{
|
|
source: '/nl/add-header',
|
|
headers: [
|
|
{
|
|
key: 'x-hello',
|
|
value: 'world',
|
|
},
|
|
],
|
|
},
|
|
{
|
|
source: '/add-header',
|
|
headers: [
|
|
{
|
|
key: 'x-hello',
|
|
value: 'world',
|
|
},
|
|
],
|
|
},
|
|
]
|
|
},
|
|
}
|