diff options
author | Daijiro Wachi <daijiro.wachi@gmail.com> | 2015-02-06 18:52:05 +0300 |
---|---|---|
committer | Daijiro Wachi <daijiro.wachi@gmail.com> | 2015-02-07 06:39:07 +0300 |
commit | f7e432e4b5191415aafd07f02fcd584e8e21407d (patch) | |
tree | d3e307eedaa26bd6822d46b8bfffdb3e492e895f /Gruntfile.js | |
parent | 8e118d19e452035d1b00576fdaff0f8b8a0acb1e (diff) |
Integrate grunt-contrib-connect for easier local development
Diffstat (limited to 'Gruntfile.js')
-rw-r--r-- | Gruntfile.js | 42 |
1 files changed, 34 insertions, 8 deletions
diff --git a/Gruntfile.js b/Gruntfile.js index f81799a..61251b8 100644 --- a/Gruntfile.js +++ b/Gruntfile.js @@ -26,7 +26,9 @@ module.exports = function (grunt) { meta: { distPath: 'dist/', docsAssetsPath: 'docs/assets/', - docsPath: 'docs/dist/', + docsDistPath: 'docs/dist/', + docsPath: 'docs/', + jsPath: 'js/', srcPath: 'sass/' }, @@ -41,7 +43,7 @@ module.exports = function (grunt) { ' */\n', clean: { - dist: ['<%= meta.distPath %>', '<%= meta.docsPath %>'] + dist: ['<%= meta.distPath %>', '<%= meta.docsDistPath %>'] }, concat: { @@ -139,7 +141,7 @@ module.exports = function (grunt) { src: [ '**/*' ], - dest: '<%= meta.docsPath %>' + dest: '<%= meta.docsDistPath %>' } }, @@ -226,11 +228,22 @@ module.exports = function (grunt) { }, watch: { - scripts: { - files: [ - '<%= meta.srcPath %>**/*.scss' - ], - tasks: ['sass'] + options: { + hostname: 'localhost', + livereload: true, + port: 8000 + }, + js: { + files: '<%= meta.jsPath %>**/*.js', + tasks: ['dist-js', 'copy'] + }, + css: { + files: '<%= meta.srcPath %>**/*.scss', + tasks: ['dist-css', 'copy'] + }, + html: { + files: '<%= meta.docsPath %>**', + tasks: ['jekyll'] } }, @@ -310,6 +323,18 @@ module.exports = function (grunt) { replacement: grunt.option('newver'), recursive: true } + }, + + connect: { + site: { + options: { + base: '_site/', + hostname: 'localhost', + livereload: true, + open: true, + port: 8000 + } + } } }); @@ -325,6 +350,7 @@ module.exports = function (grunt) { grunt.registerTask('build', ['dist']); grunt.registerTask('default', ['dist']); grunt.registerTask('test', ['dist', 'csslint', 'jshint', 'jscs', 'validate-html']); + grunt.registerTask('server', ['dist', 'jekyll', 'connect', 'watch']); grunt.registerTask('build-ratchicons-data', generateRatchiconsData); |