提交 1496ad62 编写于 作者: C Corentin.Andre 提交者: Tim Neutkens

fix: update correct path to use when exporting 404 page (#5470)

When exporting error page, next defaults it to 404/index.html which is not recognized as a default 404 page.

This should fix https://github.com/zeit/next.js/issues/5035
上级 cb312eb1
......@@ -38,7 +38,7 @@ export default async function (dir, options, configuration) {
}
if (page === '/_error') {
defaultPathMap['/404'] = { page }
defaultPathMap['/404.html'] = { page }
continue
}
......
......@@ -53,5 +53,10 @@ export default function (context) {
const html = await renderViaHTTP(context.port, '/404')
expect(html).toMatch(/404/)
})
it('should export 404.html instead of 404/index.html', async () => {
const html = await renderViaHTTP(context.port, '/404.html')
expect(html).toMatch(/404/)
})
})
}
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册