werkzeug
Version:
compiles ts, coffee, sass/scss, less/ stylus and packs browser ready bundles
56 lines (38 loc) • 1.14 kB
text/coffeescript
Chok = require 'chokidar'
EMap = require 'emap'
Log = require './utils/log'
SW = require './utils/stopwatch'
class Watcher
constructor: () ->
= .cfg
= new EMap()
watch: () ->
if
.all()
.close()
SW.start 'watcher'
= Chok.watch .base,
ignored: [.ignores]
ignoreInitial: false
usePolling: false
useFsEvents: true
.map , 'add', , @
.map , 'change', , @
.map , 'unlink', , @
.map , 'ready', , @
null
addedHandler: (path) ->
.fileAdded path
null
changedHandler: (path) ->
.fileChanged path
null
unlinkedHandler: (path) ->
.fileRemoved path
null
readyHandler: () ->
Log.info 'watcher', 'ready', SW.stop 'watcher', 0
= true
.walked()
null
module.exports = Watcher