fix(generator): ensure manifest dir exists (#8474)

This commit is contained in:
Sébastien Chopin 2020-12-11 13:34:13 +01:00 committed by GitHub
parent 739261cdde
commit dd7f767d13
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -64,6 +64,7 @@ export default class Generator {
if (this.manifest) { if (this.manifest) {
await this.nuxt.callHook('generate:manifest', this.manifest, this) await this.nuxt.callHook('generate:manifest', this.manifest, this)
const manifestPath = path.join(this.staticAssetsDir, 'manifest.js') const manifestPath = path.join(this.staticAssetsDir, 'manifest.js')
await fsExtra.ensureDir(this.staticAssetsDir)
await fsExtra.writeFile(manifestPath, `__NUXT_JSONP__("manifest.js", ${devalue(this.manifest)})`, 'utf-8') await fsExtra.writeFile(manifestPath, `__NUXT_JSONP__("manifest.js", ${devalue(this.manifest)})`, 'utf-8')
consola.success('Static manifest generated') consola.success('Static manifest generated')
} }