diff Gruntfile.js @ 341:37f426e067c4

Big refactor to get rid of this whole single page app crap. Getting back to basics!
author Ludovic Chabant <ludovic@chabant.com>
date Wed, 16 Sep 2015 23:04:28 -0700
parents 74b849875a57
children b8561bf43e32
line wrap: on
line diff
--- a/Gruntfile.js	Sun Aug 30 21:45:42 2015 -0700
+++ b/Gruntfile.js	Wed Sep 16 23:04:28 2015 -0700
@@ -1,3 +1,7 @@
+/*global module:false*/
+'use strict';
+
+
 module.exports = function(grunt) {
 
   // Project configuration.
@@ -26,19 +30,37 @@
       development: {
         options: {
           optimize: "none",
-          baseUrl: "wikked/assets",
+          baseUrl: "wikked/assets/js",
           mainConfigFile: "wikked/assets/js/wikked.js",
-          name: "js/wikked",
-          out: "wikked/static/js/wikked.min.js"
+          dir: "wikked/static/js",
+          modules: [
+          {
+              name: "wikked.app",
+              include: ["require.js"]
+          },
+          {
+              name: "wikked.edit",
+              exclude: ["wikked.app"]
+          }
+          ]
         }
       },
       production: {
         options: {
           optimize: "uglify",
-          baseUrl: "wikked/assets",
+          baseUrl: "wikked/assets/js",
           mainConfigFile: "wikked/assets/js/wikked.js",
-          name: "js/wikked",
-          out: "wikked/static/js/wikked.min.js"
+          dir: "wikked/static/js",
+          modules: [
+          {
+              name: "wikked.app",
+              include: ["require.js"]
+          },
+          {
+              name: "wikked.edit",
+              exclude: ["wikked.app"]
+          }
+          ]
         }
       }
     },
@@ -56,9 +78,6 @@
       development: {
         files: [
           //{expand: true, cwd: 'wikked/assets/', dest: 'wikked/static/', src: ['img/**']},
-          {expand: true, cwd: 'wikked/assets/', dest: 'wikked/static/', src: ['js/**']},
-          {expand: true, cwd: 'wikked/assets/', dest: 'wikked/static/', src: ['tpl/**']},
-          {expand: true, cwd: 'wikked/assets/', dest: 'wikked/static/', src: ['json/**']},
           {expand: true, cwd: 'wikked/assets/font-awesome', dest: 'wikked/static/', src: ['fonts/**']}
         ]
       },
@@ -67,12 +86,6 @@
           {expand: true, cwd: 'wikked/assets/', dest: 'wikked/static/', src: ['js/wikked.js', 'js/wikked/**']}
         ]
       },
-      dev_templates: {
-        files: [
-          {expand: true, cwd: 'wikked/assets/', dest: 'wikked/static/', src: ['tpl/**']},
-          {expand: true, cwd: 'wikked/assets/', dest: 'wikked/static/', src: ['json/**']}
-        ]
-      },
       production: {
         files: [
           {expand: true, cwd: 'wikked/assets/', dest: 'wikked/static/', src: ['js/require.js']},
@@ -89,10 +102,6 @@
         files: ['wikked/assets/js/wikked.js', 'wikked/assets/js/wikked/**'],
         tasks: ['jshint:all', 'copy:dev_scripts']
       },
-      templates: {
-        files: ['wikked/assets/tpl/**/*.html', 'wikked/assets/json/**/*.json'],
-        tasks: ['copy:dev_templates']
-      },
       styles: {
         files: ['wikked/assets/css/**/*.less'],
         tasks: ['less:development']
@@ -116,6 +125,6 @@
   grunt.registerTask('default', ['jshint', 'less:production', 'requirejs:production', 'imagemin:all', 'copy:production']);
 
   // Other tasks.
-  grunt.registerTask('dev', ['less:development', 'copy:production', 'copy:development']);
+  grunt.registerTask('dev', ['less:development', 'requirejs:development', 'copy:production', 'copy:development']);
 };