 fs = Npm.require 'fs'
 
 processFile = (step) ->
-  
+
   # check for extension as filename
   checkFilename step
 

  bundle.once 'end', -> cb undefined, string  # undefined = error

  # when there's an error, give it to the callback
  bundle.once 'error', (error) -> cb error

  # extract the source map content from the generated file to give to Meteor
  # explicitly by piping bundle thru `exorcist`
  mapFileName = step.fullInputPath+'.map'
  exorcisedBundle = bundle.pipe exorcist mapFileName, step.pathForSourceMap
  exorcisedBundle.originalBundle = bundle

  try # try-catch for browserify errors

    # get browserify result from either the cache or processing
    string = getResult step, exorcisedBundle, browserifyOptions?.cache

    # read the generated source map from the file
    sourceMap = fs.readFileSync mapFileName, encoding:'utf8'
