1
0
Fork 0
mirror of https://github.com/terribleplan/next.js.git synced 2024-01-19 02:48:18 +00:00

Do not include /_document.js when running 'next export'

This commit is contained in:
Arunoda Susiripala 2017-05-11 08:59:29 -07:00
parent 880eb4caff
commit 4be25270c6

View file

@ -94,6 +94,13 @@ function copyPages (nextDir, outDir, buildId) {
const fullFilePath = `${root}${sep}${filename}`
const relativeFilePath = fullFilePath.replace(nextBundlesDir, '')
// We should not expose this page to the client side since
// it has no use in the client side.
if (relativeFilePath === '/_document.js') {
next()
return
}
let destFilePath = null
if (/index\.js$/.test(filename)) {
destFilePath = join(outDir, '_next', buildId, 'page', relativeFilePath)