   try # try-catch for browserify errors
 
     # get browserify result from either the cache or processing
-    string = getResult step, bundle
+    string = getResult step, bundle, browserifyOptions?.cache
 
     # read the generated source map from the file
     sourceMap = fs.readFileSync mapFileName, encoding:'utf8'
-    # leave source map file so it's cached
+    # delete source map file only when caching is off
+    # otherwise leave it "cached"
+    if browserifyOptions?.cache is false then fs.unlinkSync mapFileName
 
     # now that we have the compiled result as a string we can add it using CompileStep
     # inside try-catch because this shouldn't run when there's an error.

  return readable

# get compile result via cache or compiling
getResult = (step, bundle) ->
  cacheFileName = step.fullInputPath + '.cached'
  compileChanges = checkFileChanges step, cacheFileName

  if compileChanges
    # call our wrapped function with the readable stream as its argument
    string = getString bundle #wrappedFn bundle

    # write result to a cache file
    fs.writeFileSync cacheFileName, string

  else
    string = fs.readFileSync cacheFileName, encoding:'utf8'

  return string


fs = Npm.require 'fs'

processFile = (step) ->
  
  # check for extension as filename
  checkFilename step

