From 7e8cde235470c06f8153276e4c63f47940f148e8 Mon Sep 17 00:00:00 2001 From: Corey Wilson Date: Fri, 19 Dec 2014 13:58:50 -0500 Subject: [PATCH 1/4] upgrade to grunt-contrib-connect 0.8 --- app/templates/skeleton/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/templates/skeleton/package.json b/app/templates/skeleton/package.json index 37b98d9..630ccd5 100755 --- a/app/templates/skeleton/package.json +++ b/app/templates/skeleton/package.json @@ -7,7 +7,7 @@ "grunt-browser-output": "0.1.0", "grunt-contrib-clean": "~0.5", "grunt-contrib-concat": "~0.3", - "grunt-contrib-connect": "~0.6", + "grunt-contrib-connect": "~0.8", "grunt-contrib-copy": "~0.5", "grunt-contrib-cssmin": "~0.7", "grunt-contrib-htmlmin": "~0.1", From b07d6eb77d2414c5ba761b3b0b0c565846f044d8 Mon Sep 17 00:00:00 2001 From: Corey Wilson Date: Fri, 19 Dec 2014 13:59:03 -0500 Subject: [PATCH 2/4] require connect-modrewrite --- app/templates/skeleton/package.json | 1 + 1 file changed, 1 insertion(+) diff --git a/app/templates/skeleton/package.json b/app/templates/skeleton/package.json index 630ccd5..bfe4797 100755 --- a/app/templates/skeleton/package.json +++ b/app/templates/skeleton/package.json @@ -2,6 +2,7 @@ "name": "<%= _.camelize(appname) %>", "version": "0.0.0", "devDependencies": { + "connect-modrewrite": "~0.7.9", "grunt": "~0.4", "grunt-angular-templates": "~0.5", "grunt-browser-output": "0.1.0", From fc146dced7be760792408818310a1637450a4d16 Mon Sep 17 00:00:00 2001 From: Corey Wilson Date: Fri, 19 Dec 2014 13:59:21 -0500 Subject: [PATCH 3/4] add rewrite rules so live reload can handle html5mode --- app/templates/skeleton/Gruntfile.js | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/app/templates/skeleton/Gruntfile.js b/app/templates/skeleton/Gruntfile.js index 8276ebd..4930436 100755 --- a/app/templates/skeleton/Gruntfile.js +++ b/app/templates/skeleton/Gruntfile.js @@ -40,7 +40,19 @@ module.exports = function (grunt) { connect: { main: { options: { - port: 9001 + port: 9001, + middleware: function (connect) { + var modRewrite = require('connect-modrewrite'); + return [ + modRewrite(['^[^\\.]*$ /index.html [L]']), + connect.static('.tmp'), + connect().use( + '/bower_components', + connect.static('./bower_components') + ), + connect.static('.') + ]; + } } } }, @@ -164,7 +176,7 @@ module.exports = function (grunt) { } } }, - //Imagemin has issues on Windows. + //Imagemin has issues on Windows. //To enable imagemin: // - "npm install grunt-contrib-imagemin" // - Comment in this section From e91fe86ecbbdfad8aaf0a5710ba33de6aeecc75b Mon Sep 17 00:00:00 2001 From: Corey Wilson Date: Fri, 19 Dec 2014 17:00:49 -0500 Subject: [PATCH 4/4] removed code not needed for standard install --- app/templates/skeleton/Gruntfile.js | 5 ----- 1 file changed, 5 deletions(-) diff --git a/app/templates/skeleton/Gruntfile.js b/app/templates/skeleton/Gruntfile.js index 4930436..7f51df3 100755 --- a/app/templates/skeleton/Gruntfile.js +++ b/app/templates/skeleton/Gruntfile.js @@ -45,11 +45,6 @@ module.exports = function (grunt) { var modRewrite = require('connect-modrewrite'); return [ modRewrite(['^[^\\.]*$ /index.html [L]']), - connect.static('.tmp'), - connect().use( - '/bower_components', - connect.static('./bower_components') - ), connect.static('.') ]; }