 				# isNgApp = app.substr(0, 5) is 'NGAPP'
 				# appName = if isNgApp then app.split('(')[1].split(')')[0] else app
 				appName = if app is 'NGAPP' then 'app' else app
-
-				groups.push ["#{appName}.coffee"]
+				appFile = "#{appName}.coffee"
+
+				removeFromFiles appFile
+				groups.push [appFile]
 
 				apps[app] = mods
 

				req: if req then "require ['#{trimmedRequire}']" else ''

			compiled = grunt.template.process template, data: config: config
			dest = path.resolve cwd, fileName

			grunt.file.write dest, compiled


			compiled = grunt.template.process template
			dest = path.resolve cwd, req

			removeFromFiles req
			grunt.file.write dest, compiled

		createRequire()
