mirror of
https://github.com/terribleplan/next.js.git
synced 2024-01-19 02:48:18 +00:00
use configured distDir where required (#1816)
This commit is contained in:
parent
605e739f97
commit
cb635dd9a5
|
@ -131,7 +131,7 @@ export default class Server {
|
||||||
return await renderScriptError(req, res, '/_error', error, customFields, this.renderOpts)
|
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)
|
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) {
|
export async function renderScript (req, res, page, opts) {
|
||||||
try {
|
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)
|
const realPath = await resolvePath(path)
|
||||||
await serveStatic(req, res, realPath)
|
await serveStatic(req, res, realPath)
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
|
|
Loading…
Reference in a new issue