 # get compile result via cache or compiling
 getResult = (step, bundle) ->
   cacheFileName = step.fullInputPath + '.cached'
-  compileChanges = checkFileChanges step
+  compileChanges = checkFileChanges step, cacheFileName
 
   if compileChanges
     # call our wrapped function with the readable stream as its argument

  #  2. have the cached source map file

  # if we don't have cached results then we rebuild (return true)
  unless fs.existsSync(step.fullInputPath + '.cached') and
    fs.existsSync(step.fullInputPath + '.map')
      return true

  cachedTime = fs.statSync(step.fullInputPath + '.cached').mtime.getTime()

  # if any of the files has changed then we rebuild (return true)
  for file in getFilesToCheck(step)
    # if it's a different time, then we rebuild (return true)
    if fs.existsSync(file)
      modifiedTime = fs.statSync(file).mtime.getTime()
      if cachedTime < modifiedTime
        return true

  # no changes so we can use the cached version (return false)
  return false
checkFilename = (step) ->

  if step.inputPath is 'browserify.js'

# add a source handler for config files so that they are watched for changes
Plugin.registerSourceHandler 'browserify.options.json', ->

checkFileChanges = (step, cacheFileName) ->
  # we must rebuild when:
  #  1. we don't have cached results
  #  2. files have changed which may alter the build:
