X-Git-Url: https://juplo.de/gitweb/?p=examples%2Ftemplate-development;a=blobdiff_plain;f=Gruntfile.js;h=b6aa9aa4692bdc6cb49c372aa94ef2304015d4c6;hp=a51b0fa1e744d6545c066c29b2beb11688770151;hb=HEAD;hpb=6a1435be7f6888a5d30d7e47d4fc1791561c921b diff --git a/Gruntfile.js b/Gruntfile.js index a51b0fa..b6aa9aa 100644 --- a/Gruntfile.js +++ b/Gruntfile.js @@ -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' ]); };