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:
Clark Du 2018-02-26 13:34:46 +08:00 committed by GitHub
commit f45a114021
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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)
} }