 
     watch:
       less:
-        files: ['.tmp/less/**/*.less']
-        tasks: ['less:dev']
+        files: "app/#{lessSources}"
+        tasks: ['copy:dev_less', 'less:dev']
       coffee:
-        files: ['.tmp/scripts/**/*.coffee']
-        tasks: ['coffee:dev']
-#      copy: TODO: break down into smaller tasks. this takes too long and also triggers coffee + less
-#        files: devCopySources.map (src) -> "app/#{src}"
-#        tasks: ['copy:dev']
+        files: "app/#{coffeeSources}"
+        tasks: ['copy:dev_coffee', 'coffee:dev']
+      copy:
+        files: devCopySources.map (src) -> "app/#{src}"
+        tasks: ['copy:dev']
       htmlbuild:
         files: ['app/app.html']
         tasks: ['htmlbuild:dev']

        src: devCopySources
        dest: '.tmp'
        rename: (dest, src) -> "#{dest}/#{src.replace(/(backend-mock\/|\.json$)/g, '')}"
      dist:
        expand: true
        cwd: 'app'

  grunt.loadNpmTasks 'grunt-shell'
  grunt.loadNpmTasks 'grunt-contrib-connect'

  grunt.registerTask 'copy_dev', ['copy:dev', 'copy:dev_less', 'copy:dev_coffee']
  grunt.registerTask 'compile_dev', ['coffee:dev', 'less:dev', 'htmlbuild:dev']
  grunt.registerTask 'compile_dist', ['coffee:dist', 'less:dist', 'uglify', 'htmlbuild:dist']
  grunt.registerTask 'dev', ['bower', 'copy_dev', 'compile_dev', 'connect:dev', 'watch']
  grunt.registerTask 'test', ['karma:dev']
  grunt.registerTask 'dist', ['bower', 'compile_dist', 'copy:dist']
  grunt.registerTask 'ci', ['dist','karma:ci','shell:git_tag','shell:git_push_tag']