Skip to content

Commit

Permalink
Merge branch 'canary' into hotfix/webpack5-terser
Browse files Browse the repository at this point in the history
  • Loading branch information
kodiakhq[bot] authored Dec 22, 2020
2 parents 55dfcc4 + 788183e commit 9ffae36
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 7 deletions.
17 changes: 10 additions & 7 deletions packages/next/build/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -974,13 +974,16 @@ export default async function build(
continue
}

const updatedRelativeDest = path.join(
'pages',
locale + localeExt,
// if it's the top-most index page we want it to be locale.EXT
// instead of locale/index.html
page === '/' ? '' : relativeDestNoPages
)
const updatedRelativeDest = path
.join(
'pages',
locale + localeExt,
// if it's the top-most index page we want it to be locale.EXT
// instead of locale/index.html
page === '/' ? '' : relativeDestNoPages
)
.replace(/\\/g, '/')

const updatedOrig = path.join(
exportOptions.outdir,
locale + localeExt,
Expand Down
11 changes: 11 additions & 0 deletions test/integration/i18n-support/test/shared.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,17 @@ async function addDefaultLocaleCookie(browser) {
}

export function runTests(ctx) {
if (!ctx.isDev) {
it('should not contain backslashes in pages-manifest', async () => {
const pagesManifestContent = await fs.readFile(
join(ctx.buildPagesDir, '../pages-manifest.json'),
'utf8'
)
expect(pagesManifestContent).not.toContain('\\')
expect(pagesManifestContent).toContain('/')
})
}

it('should resolve href correctly when dynamic route matches locale prefixed', async () => {
const browser = await webdriver(ctx.appPort, `${ctx.basePath}/nl`)
await browser.eval('window.beforeNav = 1')
Expand Down

0 comments on commit 9ffae36

Please sign in to comment.