 # @param {Function} callback The callback after gzipping
 
 gzipPkg = (contents, filename, callback) =>
-  file = "#{process.cwd() + @_outputDir + '/'}#{filename}"
+  file = "#{@currentDir + @_outputDir + '/'}#{filename}"
   ext = if _.endsWith filename, '.js' then '.jgz' else '.cgz'
   outputFilename = file + ext
   zlib.gzip contents, (err, buf) ->

  @_preprocessedCache = {}
  @_fingerprintCache = { js: {}, jst: {}, css: {} }

  unless fs.existsSync process.cwd() + @publicDir
    throw new Error "The directory #{@publicDir} doesn't exist"

  clearAssetsDir() if @mode is 'development'

  for filename in @assets.jst[pkg]

    # Read the file and compile it into a javascript function string
    fullPath = path.resolve @currentDir + '/' + filename

    # Find the appropriate parser for the file
    parser = _.find parsers, (parser) ->
