index.js
function watchBuild(config) {
  // verify config
  if (!lintConfig(config)) throw new Error('invalid config')

  // set development env
  CONTEXT.env = 'development'

  // build once immediately
  buildOnce(config)

  // bind watch handler
  assist.tryWatch(
    config.$path.source.client,
    function (e, file) {
      if (!file) return
      CONTEXT.entries.push(path.join(config.$path.source.client, file))
      buildOnce(config, CONTEXT)
      CONTEXT.entries = []
    }
  )
}
function watchBuild(config) {
  // verify config
  if (!lintConfig(config)) throw new Error('invalid config')

  // set development env
  CONTEXT.env = 'development'

  // build once immediately
  buildOnce(config)

  // bind watch handler
  assist.tryWatch(
    config.$path.source.client,
    function (e, file) {
      if (!file) return
      CONTEXT.entries.push(path.join(config.$path.source.client, file))
      buildOnce(config, CONTEXT)
      CONTEXT.entries = []
    }
  )
}
function watchBuild ( config ) { // verify config if ( ! lintConfig ( config ) ) throw new Error ( 'invalid config' ) // set development env CONTEXT . env = 'development' // build once immediately buildOnce ( config ) // bind watch handler assist . tryWatch ( config . $path . source . client , function ( e , file ) { if ( ! file ) return CONTEXT . entries . push ( path . join ( config . $path . source . client , file ) ) buildOnce ( config , CONTEXT ) CONTEXT . entries = [ ] } ) }
watch & build, development
watch & build development