Added markup for the integration of the template in the Spring-Thymeleaf-App
[examples/template-development] / Gruntfile.js
index a51b0fa..b6aa9aa 100644 (file)
@@ -3,6 +3,7 @@ module.exports = function(grunt) {
   grunt.loadNpmTasks('grunt-contrib-copy');
   grunt.loadNpmTasks('grunt-contrib-less');
   grunt.loadNpmTasks('grunt-contrib-watch');
+  grunt.loadNpmTasks('grunt-svgstore');
 
   grunt.initConfig({
 
@@ -13,7 +14,11 @@ module.exports = function(grunt) {
         expand: true,
         cwd: 'html',
         src: '**/*.html',
-        dest: 'dist/thymeleaf/templates',
+        dest: 'dist/thymeleaf/templates'
+      },
+      fonts: {
+        src: 'fonts/**/*',
+        dest: 'dist/'
       }
     },
 
@@ -28,6 +33,19 @@ module.exports = function(grunt) {
       }
     },
 
+    svgstore: {
+      options: {
+        cleanup: true
+      },
+      sprite: {
+        files: {
+          'dist/img/sprite.svg': [
+            'img/mo.svg'
+          ]
+        }
+      }
+    },
+
     watch: {
       copy: {
         files: [ 'html/**/*.html' ],
@@ -36,11 +54,27 @@ module.exports = function(grunt) {
       less: {
         files: [ 'less/**/*.less' ],
         tasks: [ 'less' ]
+      },
+      svgstore: {
+        files: [ 'img/**/*.svg' ],
+        tasks: [ 'svgstore' ]
       }
     }
 
   });
 
-  grunt.registerTask('default', [ 'copy', 'less' ]);
+  grunt.registerTask('http-server', function() {
+
+    grunt.util.spawn({
+      cmd: 'node_modules/http-server/bin/http-server',
+      args: [ 'dist' ],
+      opts: { stdio: 'inherit' }
+    });
+
+  });
+
+  grunt.registerTask('default', [ 'copy', 'less', 'svgstore' ]);
+
+  grunt.registerTask('run-server', [ 'default', 'http-server', 'watch' ]);
 
 };