mirror of
https://github.com/nuxt/nuxt.git
synced 2024-11-27 16:12:12 +00:00
watch for custom provided templates on edit event
This commit is contained in:
parent
12727d1165
commit
5d23dfc49e
@ -513,7 +513,7 @@ function watchPages () {
|
||||
r(this.srcDir, 'pages/**/*.vue'),
|
||||
r(this.srcDir, 'layouts/*.vue'),
|
||||
r(this.srcDir, 'layouts/**/*.vue')
|
||||
].concat(this.options.build.watch)
|
||||
]
|
||||
const options = Object.assign({}, this.options.watchers.chokidar, {
|
||||
ignoreInitial: true
|
||||
})
|
||||
@ -521,7 +521,11 @@ function watchPages () {
|
||||
const refreshFiles = _.debounce(() => {
|
||||
co(generateRoutesAndFiles.bind(this))
|
||||
}, 200)
|
||||
this.pagesFilesWatcher = chokidar.watch(_.uniq(patterns), options)
|
||||
// Watch for internals
|
||||
this.pagesFilesWatcher = chokidar.watch(patterns, options)
|
||||
.on('add', refreshFiles)
|
||||
.on('unlink', refreshFiles)
|
||||
// Watch for custom provided files
|
||||
this.customFilesWatcher = chokidar.watch(_.uniq(this.options.build.watch), options)
|
||||
.on('change', refreshFiles)
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user