   expandAssetGlobs()
 
   unless @usingMiddleware
-    fs.writeFileSync (process.cwd() + @_outputDir + '/' + pkg + '.jst.js'), generateJSTs pkg
-    fs.writeFileSync (process.cwd() + @_outputDir + '/nap-templates-prefix.js'), @_tmplPrefix
+    fs.writeFileSync (@currentDir + @_outputDir + '/' + pkg + '.jst.js'), generateJSTs pkg
+    fs.writeFileSync (@currentDir + @_outputDir + '/nap-templates-prefix.js'), @_tmplPrefix
 
   """
   <script src='#{@_assetsDir}/nap-templates-prefix.js' type='text/javascript'></script>

# @param {Function} callback The callback after gzipping

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

# Deletes all of the files in the assets directory.

clearAssetsDir = =>
  rimraf.sync "#{path.join(__dirname, '..', '..', '..')}/#{@publicDir}/assets"
  fs.mkdirSync(path.join(__dirname, '..', '..', '..') + @_outputDir, '0755')
