   @loadNpmTasks 'grunt-contrib-imagemin'
   @loadNpmTasks 'grunt-contrib-watch'
   @loadNpmTasks 'grunt-processhtml'
-  @loadNpmTasks 'grunt-contrib-connect'
-
-  @registerTask 'deploy', ['default', 'shell:package', 'shell:install', 'shell:getid', 'shell:launch']
-
-  @registerTask 'server', ['copy:build', 'connect:server', 'watch']
-
-  @registerTask 'default', ['clean', 'jshint', 'uglify', 'cssmin', 'processhtml', 'htmlmin', 'copy']
+  @loadNpmTasks 'grunt-express'
+  @loadNpmTasks 'grunt-shell'
+
+
+  @registerTask 'dev', ['clean:dev', 'copy:devindex', 'copy:devjs', 'copy:devcss', 'copy:devassets']
+
+  @registerTask 'server', ['dev', 'express', 'watch']
+
+  @registerTask 'deploy', ['dist', 'shell:package', 'shell:install', 'shell:getid', 'shell:launch']
+
+  @registerTask 'dist', ['clean:dist', 'jshint', 'uglify', 'cssmin', 'processhtml', 'htmlmin', 'copy:distassets', 'copy:project']
+
+  @registerTask 'default', ['dist']

        files:
          '<%= DIST_DIR %><%= INDEX_FILE %>': '<%= INDEX_FILE %>'

    connect:
      server:
        options:
          port: 9000
          base: 'dev'
          livereload: true
          open: true


    watch:
      options:


      launch:
        command: ->
          appid = grunt.config.get 'APP_ID'

          if (!appid)
            return grunt.task.clearQueue().run(['shell:getid', 'shell:launch'])

          appname = @config.get 'APP_NAME'

          if appid
            "webtizen -r -i #{appid}.#{appname}"

      uninstall:
        command: ->
          appid = @config.get 'APP_ID'
          if appid
            "webtizen -u -i #{appid}"

      debug:
        command: ->
          appid = @config.get 'APP_ID'
          if appid
            "webtizen -d -i #{appid}"

