Skip to content

Instantly share code, notes, and snippets.

@philippkeller
Forked from blockloop/Gruntfile.js
Last active August 29, 2015 14:02
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save philippkeller/67f20ebe360327d9ce68 to your computer and use it in GitHub Desktop.
Save philippkeller/67f20ebe360327d9ce68 to your computer and use it in GitHub Desktop.
Setup for auto reload (livereload) changes of coffeescript in hexo
module.exports = ->
@initConfig
watch:
sourceFiles:
options:
livereload: true
files: ['themes/**','scaffolds/**','scripts/**','source/**','!source/**/site.coffee','app.js']
tasks: ['shell:hexoGen']
coffee:
options:
livereload: true
files: ['source/**/site.coffee']
tasks: ['shell:clean_coffee', 'shell:hexoGen']
shell:
hexoGen:
command: 'hexo generate'
clean:
command: 'rm -rf public'
clean_coffee:
command: 'rm public/scripts/site.js'
connect:
server:
options:
base: 'public'
hostname: '*'
livereload: true
@loadNpmTasks 'grunt-shell'
@loadNpmTasks 'grunt-contrib-watch'
@loadNpmTasks 'grunt-contrib-connect'
@loadNpmTasks 'grunt-shell'
@registerTask 'default', ['connect', 'watch']
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment