mirror of
https://github.com/nuxt/nuxt.git
synced 2025-01-31 07:40:33 +00:00
Merge pull request #2884 from shirohana/feature/watch-style-resources
Feature: watch `options.build.styleResources` as default in dev mode
This commit is contained in:
commit
f45a114021
@ -668,11 +668,15 @@ module.exports = class Builder {
|
|||||||
.on('unlink', refreshFiles)
|
.on('unlink', refreshFiles)
|
||||||
|
|
||||||
// Watch for custom provided files
|
// Watch for custom provided files
|
||||||
const watchFiles = _.map(_.uniq(this.options.build.watch), p =>
|
let customPatterns = _.concat(
|
||||||
|
this.options.build.watch,
|
||||||
|
..._.values(_.omit(this.options.build.styleResources, ['options']))
|
||||||
|
)
|
||||||
|
customPatterns = _.map(_.uniq(customPatterns), p =>
|
||||||
upath.normalizeSafe(p)
|
upath.normalizeSafe(p)
|
||||||
)
|
)
|
||||||
this.customFilesWatcher = chokidar
|
this.customFilesWatcher = chokidar
|
||||||
.watch(watchFiles, options)
|
.watch(customPatterns, options)
|
||||||
.on('change', refreshFiles)
|
.on('change', refreshFiles)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user