Skip to content

Commit 44715eb

Browse files
author
Brian Muenzenmeyer
committed
Merge pull request #64 from marcinmodestowicz/master
Add livereload support to Grunt serve task
2 parents bab8e8c + 7c3b59e commit 44715eb

File tree

3 files changed

+8
-9
lines changed

3 files changed

+8
-9
lines changed

Gruntfile.js

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,9 @@ module.exports = function(grunt) {
5151
// tasks: ['default']
5252
// },
5353
all: {
54+
options: {
55+
livereload: true
56+
},
5457
files: [
5558
'source/_patterns/**/*.mustache',
5659
'source/_patterns/**/*.json',
@@ -81,7 +84,8 @@ module.exports = function(grunt) {
8184
port: 9001,
8285
base: './public',
8386
hostname: 'localhost',
84-
keepalive: true
87+
open: true,
88+
livereload: 35729
8589
}
8690
}
8791
}
@@ -99,9 +103,6 @@ module.exports = function(grunt) {
99103
//travis CI task
100104
grunt.registerTask('travis', ['clean', 'concat', 'patternlab', /*'sass',*/ 'copy', 'nodeunit']);
101105

102-
grunt.registerTask('serve', ['clean', 'concat', 'patternlab', /*'sass',*/ 'copy', 'connect:app']);
103-
//need to get livereload working
104-
//http://www.thecrumb.com/2014/03/16/using-grunt-for-live-reload-revisited/
105-
//http://rhumaric.com/2013/07/renewing-the-grunt-livereload-magic/
106+
grunt.registerTask('serve', ['clean', 'concat', 'patternlab', /*'sass',*/ 'copy', 'connect', 'watch']);
106107

107108
};

README.md

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -76,9 +76,7 @@ Pattern states should be lowercase and use hyphens where spaces are present.
7676
```
7777

7878
##### Server
79-
Running `grunt serve` will compile the patternlab front end and host it on <a href="http://localhost:9001">http://localhost:9001</a> by default. This can be changed in the `Gruntfile.js`
80-
81-
**Next steps: Livereload and watches**
79+
Running `grunt serve` will compile the patternlab front end and host it on <a href="http://localhost:9001">http://localhost:9001</a> by default. Page will reload on any saved source code change.
8280

8381
### Under Active Development
8482

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
"version": "0.1.4",
55
"devDependencies": {
66
"grunt": "~0.4.0",
7-
"grunt-contrib-watch": "~0.2.0",
7+
"grunt-contrib-watch": "~0.6.1",
88
"grunt-contrib-sass": "~0.2.2",
99
"grunt-contrib-copy": "~0.4.0",
1010
"grunt-contrib-jshint": "~0.4.0",

0 commit comments

Comments
 (0)