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

render: fix bundle path

This commit is contained in:
nkzawa 2016-10-06 10:21:15 +09:00
parent 2d8959d99c
commit ebb7bc5fbc

View file

@ -14,7 +14,7 @@ export async function render (path, req, res, { root = process.cwd() } = {}) {
props = await Component.getInitialProps({ req, res })
}
const bundlePath = resolve(root, '.next', '.next', 'pages', path || 'index.js')
const bundlePath = resolve(root, '.next', '.next', 'pages', (path || 'index') + '.js')
const component = await fs.readFile(bundlePath, 'utf8')
const app = createElement(App, {