Permalink
Browse files

Emit change events for ignored files

This allows plugins like `wintersmith-livereload` to react to files outside the pipeline.
  • Loading branch information...
jnordberg committed Jun 17, 2017
1 parent 7d85a6f commit 91acc99b8e06267b1f18b3ea62e8add1362819c5
Showing with 6 additions and 6 deletions.
  1. +6 −6 src/core/server.coffee
View
@@ -82,7 +82,7 @@ setup = (env) ->
changeHandler = (error, path) ->
### Emits a change event if called without error ###
unless error?
env.emit 'change', path
env.emit 'change', path, false
logop error
loadContents = (callback=logop) ->
@@ -121,16 +121,16 @@ setup = (env) ->
callback error
contentWatcher = chokidar.watch env.contentsPath,
ignored: (path) ->
for pattern in env.config.ignore
if minimatch env.relativeContentsPath(path), pattern
return true
return false
ignoreInitial: true
# reload content tree on changes
contentWatcher.on 'all', (type, filename) ->
return if block.contentsLoad
relpath = env.relativeContentsPath filename
for pattern in env.config.ignore
if minimatch relpath, pattern
env.emit 'change', relpath, true
return
loadContents (error) ->
contentFilename = null
if not error? and filename?

0 comments on commit 91acc99

Please sign in to comment.