refactor: use resloveAlias for watch

This commit is contained in:
Clark Du 2018-08-13 22:21:53 +01:00
parent 5ddc394a50
commit 85a8af570d
2 changed files with 5 additions and 3 deletions

View File

@ -400,8 +400,8 @@ export default class Builder {
r, r,
wp, wp,
wChunk, wChunk,
resolvePath: this.nuxt.resolvePath.bind(this.nuxt), resolvePath: this.nuxt.resolvePath,
resolveAlias: this.nuxt.resolveAlias.bind(this.nuxt), resolveAlias: this.nuxt.resolveAlias,
relativeToBuild: this.relativeToBuild relativeToBuild: this.relativeToBuild
} }
}) })
@ -639,7 +639,7 @@ export default class Builder {
}) })
const nuxtRestartWatch = _.concat( const nuxtRestartWatch = _.concat(
this.options.watch.map(r), this.options.watch.map(this.nuxt.resolveAlias),
path.join(this.options.rootDir, 'nuxt.config.js') path.join(this.options.rootDir, 'nuxt.config.js')
) )
this.watchers.restart = chokidar this.watchers.restart = chokidar

View File

@ -37,6 +37,8 @@ export default class Nuxt {
this.renderAndGetWindow = this.renderer.renderAndGetWindow.bind( this.renderAndGetWindow = this.renderer.renderAndGetWindow.bind(
this.renderer this.renderer
) )
this.resolvePath = this.resolvePath.bind(this)
this.resolveAlias = this.resolveAlias.bind(this)
// ESM Loader // ESM Loader
this.esm = esm(module, {}) this.esm = esm(module, {})