add grunt JST to compilate the templates
authorrougeronj
Sat, 18 Apr 2015 16:47:18 +0200
changeset 416 54a9de7e2b45
parent 415 ac6c9eec7fc4
child 417 e98756860daa
add grunt JST to compilate the templates
client/gruntfile.js
client/package.json
--- a/client/gruntfile.js	Mon Mar 30 10:11:32 2015 +0200
+++ b/client/gruntfile.js	Sat Apr 18 16:47:18 2015 +0200
@@ -14,7 +14,8 @@
       'js/ldtjson-bin.js',
       'js/list-bin.js',
       'js/wikipedia-bin.js',
-      'dist/js/paper-renderer.js'
+      'dist/js/templates.js',
+      'dist/js/paper-renderer.js',
   ];
 
   var renkan_banner = grunt.file.read('js/header.js').toString() +
@@ -41,6 +42,20 @@
         }
       }
     },
+    jst: {
+		compile: {
+			options: {
+				templateSettings: {
+					//interpolate : /\{\{(.+?)\}\}/g
+				},
+				namespace: 'renkanJST',
+				//amd: true
+			},
+			files: {
+				"dist/js/templates.js": ["templates/*.html"]
+			}
+		}
+    },
     uglify: {
       options: {
         banner: renkan_banner,
@@ -68,6 +83,7 @@
         force: true
       },
       renderer: ["dist/js/paper-renderer.js"],
+      jst:["dist/js/templates.js"],
       renkan: ["dist/"],
       lib: ["lib/"],
     },
@@ -158,9 +174,10 @@
   grunt.loadNpmTasks('grunt-contrib-jshint');
   grunt.loadNpmTasks('grunt-contrib-connect');
   grunt.loadNpmTasks('grunt-bower-task');
+  grunt.loadNpmTasks('grunt-contrib-jst');
 
   // Default task(s).
-  grunt.registerTask('default', ['jshint', 'requirejs', 'concat', 'uglify', 'cssmin', 'bower:install', 'copy:renkan', 'copy:renkan_css', 'clean:renderer']);
+  grunt.registerTask('default', ['jshint', 'requirejs', 'jst', 'concat', 'uglify', 'cssmin', 'bower:install', 'copy:renkan', 'copy:renkan_css', 'clean:renderer', 'clean:jst']);
   grunt.registerTask('copy-server', 'copy files to server part', function(){
       grunt.task.run(['copy:renkan_server']);
   });
--- a/client/package.json	Mon Mar 30 10:11:32 2015 +0200
+++ b/client/package.json	Sat Apr 18 16:47:18 2015 +0200
@@ -17,6 +17,7 @@
     "grunt-contrib-copy": "^0.5.0",
     "grunt-contrib-cssmin": "^0.9.0",
     "grunt-contrib-jshint": "^0.10.0",
+    "grunt-contrib-jst": "^0.6.0",
     "grunt-contrib-requirejs": "^0.4.4",
     "grunt-contrib-uglify": "^0.4.0",
     "jshint-stylish": "^0.2.0"