From: Kai Moritz Date: Mon, 24 Aug 2015 08:53:46 +0000 (+0200) Subject: Added a task to start a webserver for comfortable developing X-Git-Tag: 1.0.4 X-Git-Url: https://juplo.de/gitweb/?p=examples%2Ftemplate-development;a=commitdiff_plain;h=985808aff630048a47bc64889f9fab1993314d0b Added a task to start a webserver for comfortable developing * All files are watched for changes and compiled automatically * A local webserver is started to serve the files likt in production --- diff --git a/Gruntfile.js b/Gruntfile.js index f62594c..b6aa9aa 100644 --- a/Gruntfile.js +++ b/Gruntfile.js @@ -63,6 +63,18 @@ module.exports = function(grunt) { }); + 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' ]); + }; diff --git a/package.json b/package.json index 38da0a5..e77a4e1 100644 --- a/package.json +++ b/package.json @@ -1,8 +1,9 @@ { "name": "frontend", - "version": "1.0.3", + "version": "1.0.4", "description": "Simple Example-Project for Template-Development", "devDependencies": { + "http-server": "~0.8.0", "grunt": "~0.4.5", "grunt-contrib-copy": "~0.8.1", "grunt-contrib-less": "~1.0.1",