1
0
Fork 0
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:
Dieter Luypaert 2017-05-02 02:42:01 +02:00 committed by Arunoda Susiripala
parent 605e739f97
commit cb635dd9a5
2 changed files with 3 additions and 2 deletions

View file

@ -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)
},

View file

@ -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) {