From 985808aff630048a47bc64889f9fab1993314d0b Mon Sep 17 00:00:00 2001 From: Kai Moritz Date: Mon, 24 Aug 2015 10:53:46 +0200 Subject: [PATCH] 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 --- Gruntfile.js | 12 ++++++++++++ package.json | 3 ++- 2 files changed, 14 insertions(+), 1 deletion(-) 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", -- 2.20.1