mirror of
https://github.com/nuxt/nuxt.git
synced 2024-11-27 08:02:01 +00:00
fix(generator): improve error handling when build does not exists (#7335)
[release]
This commit is contained in:
parent
80396cbf41
commit
631be3a1dd
@ -66,10 +66,11 @@ export default class Generator {
|
|||||||
await this.builder.build()
|
await this.builder.build()
|
||||||
this.isFullStatic = isFullStatic(this.options)
|
this.isFullStatic = isFullStatic(this.options)
|
||||||
} else {
|
} else {
|
||||||
const hasBuilt = await fsExtra.exists(this.srcBuiltPath)
|
const hasBuilt = await fsExtra.exists(path.resolve(this.options.buildDir, 'dist', 'server', 'client.manifest.json'))
|
||||||
if (!hasBuilt) {
|
if (!hasBuilt) {
|
||||||
|
const fullStaticArgs = isFullStatic(this.options) ? ' --target static' : ''
|
||||||
throw new Error(
|
throw new Error(
|
||||||
`No build files found in ${this.srcBuiltPath}.\nPlease run \`nuxt build --target static\` before calling \`nuxt export\``
|
`No build files found in ${this.srcBuiltPath}.\nPlease run \`nuxt build${fullStaticArgs}\` before calling \`nuxt export\``
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
const config = this.getBuildConfig()
|
const config = this.getBuildConfig()
|
||||||
|
Loading…
Reference in New Issue
Block a user