Commit cb635dd9 authored by Dieter Luypaert's avatar Dieter Luypaert Committed by Arunoda Susiripala

use configured distDir where required (#1816)

parent 605e739f
......@@ -131,7 +131,7 @@ export default class Server {
return await renderScriptError(req, res, '/_error', error, customFields, this.renderOpts)
}
const p = join(this.dir, '.next/bundles/pages/_error.js')
const p = join(this.dir, `${this.dist}/bundles/pages/_error.js`)
await this.serveStatic(req, res, p)
},
......
......@@ -109,7 +109,8 @@ async function doRender (req, res, pathname, query, {
export async function renderScript (req, res, page, opts) {
try {
const path = join(opts.dir, '.next', 'bundles', 'pages', page)
const dist = getConfig(opts.dir).distDir
const path = join(opts.dir, dist, 'bundles', 'pages', page)
const realPath = await resolvePath(path)
await serveStatic(req, res, realPath)
} catch (err) {
......
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