better No build files found error

This commit is contained in:
Pooya Parsa 2017-06-14 03:17:22 +04:30
parent ce5cb62ee6
commit 76c3b358cc

View File

@ -128,7 +128,7 @@ export default class Builder extends Tapable {
const bundlePath = join(serverConfig.output.path, 'server-bundle.json') const bundlePath = join(serverConfig.output.path, 'server-bundle.json')
const manifestPath = join(serverConfig.output.path, 'client-manifest.json') const manifestPath = join(serverConfig.output.path, 'client-manifest.json')
if (!fs.existsSync(bundlePath) || !fs.existsSync(manifestPath)) { if (!fs.existsSync(bundlePath) || !fs.existsSync(manifestPath)) {
throw new Error('No build files found, please run `nuxt build` before launching `nuxt start`') throw new Error(`No build files found in ${serverConfig.output.path}, please run \`nuxt build\` before launching \`nuxt start\``)
} }
const bundle = fs.readFileSync(bundlePath, 'utf8') const bundle = fs.readFileSync(bundlePath, 'utf8')
const manifest = fs.readFileSync(manifestPath, 'utf8') const manifest = fs.readFileSync(manifestPath, 'utf8')