refactor: prevent wrapper Promise

This commit is contained in:
Clark Du 2017-11-24 16:21:08 +08:00 committed by Pooya Parsa
parent c15543cb83
commit 7a301bed6c

View File

@ -61,7 +61,7 @@ export default class Builder {
// Stop watching on nuxt.close()
if (this.options.dev) {
this.nuxt.hook('close', async () => { await this.unwatch() })
this.nuxt.hook('close', () => this.unwatch())
}
}
@ -519,11 +519,13 @@ export default class Builder {
r(src, 'layouts/*.vue'),
r(src, 'layouts/**/*.vue')
]
this._nuxtPages && patterns.push(
r(src, 'pages'),
r(src, 'pages/*.vue'),
r(src, 'pages/**/*.vue')
)
if (this._nuxtPages) {
patterns.push(
r(src, 'pages'),
r(src, 'pages/*.vue'),
r(src, 'pages/**/*.vue')
)
}
const options = Object.assign({}, this.options.watchers.chokidar, {
ignoreInitial: true
})