Index: Dev/trunk/Gruntfile.js
===================================================================
--- Dev/trunk/Gruntfile.js	(revision 463)
+++ Dev/trunk/Gruntfile.js	(revision 464)
@@ -1,19 +1,19 @@
-/***************************************
- * This Gruntfile is organized with two phases,
- * compile and build. Compile will lint HTML,
- * JavaScript and compile LESS. The build phase
- * creates an optimized stand-alone build that
- * can be distributed.
+/** Gruntfile - control build and deploy tasks
  */
 
 module.exports = function(grunt) {
 
+    var srcDir   = 'src/';
     var buildDir = 'build/';
-    var srcDir   = 'src/';
+    var developmentDir = buildDir+'development/';
+    var productionDir = buildDir+'production/';
 
     grunt.initConfig({
         clean: {
-            build: {
-                src: [buildDir]
+            development: {
+                src: [developmentDir]
+            },
+            production: {
+                src: [productionDir]
             }
         },
@@ -27,5 +27,5 @@
                     cwd: srcDir,
                     src: ['client/qed-client/**/*.coffee', 'server/**/*.coffee'],
-                    dest: buildDir,
+                    dest: developmentDir,
                     ext: '.js'
                 }]
@@ -33,19 +33,43 @@
         },
         copy: {
+            'client-deps': {
+                files: [{
+                    expand: true,
+                    cwd: srcDir,
+                    src: ['client/dojo/**', 'client/dijit/**', 'client/dojox/**', 'client/util/**'],
+                    dest: developmentDir
+                }]
+            },
+            'server-deps': {
+                files: [{
+                    expand: true,
+                    cwd: srcDir,
+                    src: ['node_modules/**'],
+                    dest: developmentDir
+                }]
+            },
             compile: {
                 files: [{
-                    src: [srcDir+'**', '!**/*.coffee' ],
-                    dest: buildDir
+                    expand: true,
+                    cwd: srcDir,
+                    src: ['**', '!**/*.coffee', '!**/*.less', '!node_modules/**', '!client/dojo/**', '!client/dijit/**', '!client/dojox/**', '!client/util/**' ],
+                    dest: developmentDir
+                }]
+            },
+            deploy: {
+                files: [{
+                    expand: true,
+                    cwd: developmentDir,
+                    src: ['**', '!client/*/**' ],
+                    dest: productionDir
                 }]
             }
         },
         dojo: {
-            options: {
-                dojo: srcDir+'client/dojo/dojo.js'
-            },
-            build: {
+            deploy: {
                 options: {
-                    profile: srcDir+'client/client.profile.js',
-                    releaseDir: buildDir
+                    dojo: developmentDir+'client/dojo/dojo.js',
+                    profile: developmentDir+'client/client.profile.js',
+                    releaseDir: '../../../'+productionDir
                 }
             }
@@ -85,5 +109,5 @@
                     cwd: srcDir,
                     src: ['client/qed-client/css/qed.less'],
-                    dest: buildDir,
+                    dest: developmentDir,
                     ext: '.css'
                 }]
@@ -97,12 +121,16 @@
     grunt.loadNpmTasks('grunt-contrib-jshint');
     grunt.loadNpmTasks('grunt-contrib-less');
-    grunt.loadNpmTasks('grunt-curl');
     grunt.loadNpmTasks('grunt-dojo');
     grunt.loadNpmTasks('grunt-htmlhint');
-    grunt.loadNpmTasks('grunt-zip');
 
+    // development tasks
+    grunt.registerTask('install-deps', ['copy:server-deps', 'copy:client-deps']);
     grunt.registerTask('compile', ['less:compile', 'jshint:compile', 'htmlhint:compile', 'coffee:compile', 'copy:compile']);
-    grunt.registerTask('build', ['clean:build', 'compile', 'dojo:build']);
-    grunt.registerTask('deploy', []);
+    grunt.registerTask('build', ['clean:development', 'install-deps', 'compile']);
+
+    // production tasks
+    grunt.registerTask('deploy', ['clean:production', 'copy:deploy', 'dojo:deploy']);
+
+    // default task is quick compile
     grunt.registerTask('default', ['compile']);
 
