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

Refactor readBuildId. (#5720)

This commit is contained in:
Anderson Leite 2018-11-20 16:56:11 -08:00 committed by Tim Neutkens
parent c870d03aa0
commit 8af767b52d

View file

@ -256,8 +256,6 @@ export default class Server {
if (!fs.existsSync(resolve(this.distDir, BUILD_ID_FILE))) {
throw new Error(`Could not find a valid build in the '${this.distDir}' directory! Try building your app with 'next build' before starting the server.`)
}
const buildIdPath = join(this.distDir, BUILD_ID_FILE)
const buildId = fs.readFileSync(buildIdPath, 'utf8')
return buildId.trim()
return fs.readFileSync(join(this.distDir, BUILD_ID_FILE), 'utf8').trim()
}
}