Skip to content

Commit

Permalink
feat(build): livereload
Browse files Browse the repository at this point in the history
added grunt serve ability
livereload on sccs changes
  • Loading branch information
ygatesoupe committed Dec 2, 2015
1 parent c699688 commit ae4d9cc
Show file tree
Hide file tree
Showing 2 changed files with 39 additions and 6 deletions.
42 changes: 37 additions & 5 deletions Gruntfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,9 @@ module.exports = function (grunt) {
return string.replace(/[-\\^$*+?.()|[\]{}]/g, '\\$&');
};

/* boosted mod */
var serveStatic = require('serve-static');
/* end mod */
var fs = require('fs');
var path = require('path');
var glob = require('glob');
Expand Down Expand Up @@ -336,14 +339,28 @@ module.exports = function (grunt) {
}
},

/* boosted mod */
connect: {
server: {
// server: {
// options: {
// port: 3000,
// base: '.'
// }
// }
// },
livereload: {
options: {
port: 3000,
base: '.'
open: true,
port: 9000,
middleware: function (connect) {
return [
serveStatic('_gh_pages')
];
}
}
}
},
},
/* end mod */

jekyll: {
options: {
Expand Down Expand Up @@ -380,7 +397,12 @@ module.exports = function (grunt) {
},
sass: {
files: 'scss/**/*.scss',
tasks: ['dist-css', 'docs']
tasks: ['dist-css', 'docs'],
/* boosted mod */
options: {
livereload: '<%= connect.options.livereload %>'
}
/* end mod */
},
docs: {
files: 'docs/assets/scss/**/*.scss',
Expand Down Expand Up @@ -541,4 +563,14 @@ module.exports = function (grunt) {
done();
});
});

/* boosted mod */
grunt.registerTask('serve', 'Compile then start a connect web server', function (target) {
grunt.task.run([
'dist',
'connect:livereload',
'watch'
]);
});
/* end mod */
};
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,8 @@
"markdown-it": "^5.0.0",
"mq4-hover-shim": "^0.3.0",
"npm-shrinkwrap": "^200.1.0",
"time-grunt": "^1.2.1"
"time-grunt": "^1.2.1",
"serve-static": "^1.10.0"
},
"engines": {
"node": ">=0.10.1"
Expand Down

0 comments on commit ae4d9cc

Please sign in to comment.