Commit 4be25270 authored by Arunoda Susiripala's avatar Arunoda Susiripala

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

parent 880eb4ca
......@@ -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)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment