18980a6411
The previous RegExp for data routes when i18n was enabled yielded a pattern like: ``` ^\/_next\/data\/development\/(?<nextLocale>.+?)\/about.json$ ^\/_next\/data\/development\/(?<nextLocale>.+?)\/blog/about.json$ ``` But the capture group for the `nextLocale` did so greedily, where the following: ``` /_next/data/development/en-US/blog/about.json ``` Would actually match both routes. This changes it to prevent the locale from including a `/` via `[^/]`, resulting in the new expressions: ``` ^\/_next\/data\/development\/(?<nextLocale>[^/]+?)\/about.json$ ^\/_next\/data\/development\/(?<nextLocale>[^/]+?)\/blog/about.json$ ```
9 lines
142 B
JavaScript
9 lines
142 B
JavaScript
/**
|
|
* @type {import('next').NextConfig}
|
|
*/
|
|
module.exports = {
|
|
i18n: {
|
|
locales: ['en-CA', 'fr-CA'],
|
|
defaultLocale: 'en-CA',
|
|
},
|
|
}
|