 		files: angularCoffees
 		tasks: 'compile-angular'
 		
-	config.wrap.angularControllers =
-		files: ['app/js/controllers.js'].map (file) -> src: file, dest: file
-		wrapper: [
-			"'use strict';\n\n"
-			''
-		]
-			
 	parseAngularModuleTypeAndName = (filepath) ->
-	
-		matches = filepath.match /^app\/js\/(.*)\/(.*\.js)$/
 		
-		moduleType: matches[1]
-		moduleName: path.basename filepath, path.extname matches[2]
+		parts = path.dirname(filepath).split path.sep
+		parts.push path.basename filepath, '.js'
+		
+		moduleType: parts[2]
+		moduleName: parts.slice(3).join '.'
 		
 	config.wrap.angularModules =
 		files: angularModules.map (file) -> src: file, dest: file
 		options:
-			indent: '    '
+			indent: '  '
 			wrapper: (filepath) ->
 				
 				{moduleType, moduleName} = parseAngularModuleTypeAndName filepath

		(angularModulesByType[matches[1]] ?= []).push mapping.dest
		
		angularModules.push mapping.dest
	
	angularModuleConcat = for directory in directories
		src: "app/js/#{directory}/*.js"
		dest: "app/js/#{directory}.js"
	
	config.clean ?= {}
	config.concat ?= {}
	config.coffee ?= {}

		'wrap:angularModules'
		'concat:angularModules'
		'wrap:angularParentModules'
		'clean:angularBuild'
	]
	
