diff --git a/packages/next/build/index.ts b/packages/next/build/index.ts index 96ae19b413b5..dd87c15fede9 100644 --- a/packages/next/build/index.ts +++ b/packages/next/build/index.ts @@ -334,7 +334,7 @@ export default async function build( } }), dataRoutes: [], - i18n: config.experimental.i18n, + i18n: config.experimental.i18n || undefined, } await promises.mkdir(distDir, { recursive: true }) diff --git a/test/integration/i18n-support/test/index.test.js b/test/integration/i18n-support/test/index.test.js index c34cdc488221..94e4eea25fa9 100644 --- a/test/integration/i18n-support/test/index.test.js +++ b/test/integration/i18n-support/test/index.test.js @@ -27,6 +27,31 @@ let appPort const locales = ['en-US', 'nl-NL', 'nl-BE', 'nl', 'fr-BE', 'fr', 'en'] function runTests(isDev) { + if (!isDev) { + it('should add i18n config to routes-manifest', async () => { + const routesManifest = await fs.readJSON( + join(appDir, '.next/routes-manifest.json') + ) + + expect(routesManifest.i18n).toEqual({ + locales: ['en-US', 'nl-NL', 'nl-BE', 'nl', 'fr-BE', 'fr', 'en'], + defaultLocale: 'en-US', + domains: [ + { + http: true, + domain: 'example.be', + defaultLocale: 'nl-BE', + }, + { + http: true, + domain: 'example.fr', + defaultLocale: 'fr', + }, + ], + }) + }) + } + it('should update asPath on the client correctly', async () => { for (const check of ['en', 'En']) { const browser = await webdriver(appPort, `/${check}`)