Use nuxt.build() instead of promises

This commit is contained in:
Pooya Parsa 2016-12-08 20:04:51 +03:30 committed by GitHub
parent 4d7102c3e1
commit 8c592ec3ae

View File

@ -84,13 +84,10 @@ const options = {
}
// Launch nuxt build with given options
new Nuxt(options)
.then((nuxt) => {
// You can use nuxt.render(req, res) or nuxt.renderRoute(route, context)
})
.catch((error) {
// If an error appended while building the project
})
// TODO: you can wrap below inside try/catch to catch any errors.
let nuxt = new Nuxt(options).build();
// You can use nuxt.render(req, res) or nuxt.renderRoute(route, context)
```