我无法让'grunt watch'启用'livereload'

时间:2014-03-05 01:34:47

标签: gruntjs livereload

我正在使用 jekyll 项目,并且在构建我的grunt文件的过程中,我已经能够使脚本连接并缩小,购买我在刷新浏览器时遇到问题。 ..

这是我的咕噜文件。

module.exports = function(grunt) {
grunt.loadNpmTasks('grunt-contrib-uglify');
grunt.loadNpmTasks('grunt-contrib-watch');
grunt.initConfig({
    uglify: {
        my_target: {
            files: {
                '_site/assets/js/miniFlapJacks.js': ['assets/js/*.js', 'assets/js/plugins/*.js', 'assets/js/vendor/*.js']
            } //files
        } //my_target
    }, //uglify
    watch: {
        options: { livereload: true},
        scripts: {
            files: ['assets/js/*.js', 'assets/js/plugins/*.js', 'assets/js/vendor/*.js'],
            tasks: ['uglify']
        }, // scripts
        html: {
            files:[  '_includes/*.html',
            '_layouts/*.html',
            '_config.yml',
            'index.html']
        }
    } //watch
}) //initConfig
grunt.registerTask('default', 'watch');
} //exports

这是我的package.json文件。

 {
      "name": "aortizRefresh",
      "author": "antonio ortiz <17antonio.ortiz@gmail.com>",
      "version" : "0.0.3",
      "homepage": "http://mmistakes.github.io/so-simple-theme/",
      "repository": {
      "type": "git",
      "url": "git://github.com/mmistakes/so-simple-theme.git"
    },
      "bugs": {
      "url": "https://github.com/mmistakes/so-simple-theme/issues"
    },
      "engines": {
      "node": ">= 0.10.0"
    },
     "dependencies": {
     "grunt": "~0.4.1",
     "grunt-contrib-watch": "~0.5.3",
     "grunt-contrib-clean": "~0.5.0",
     "grunt-contrib-uglify": "~0.2.2",
     "grunt-contrib-sass": "~0.7.2",
     "grunt-contrib-jshint": "~0.6.3",
     "grunt-recess": "~0.3.5",
     "grunt-contrib-imagemin": "~0.2.0",
     "grunt-svgmin": "~0.2.0"
    }
 }

任何帮助将不胜感激!

我通过[1]找到答案:http://kctang.github.io/jekyll/livereload/2014/01/25/github-pages-with-jekyll-and-livereload.html/

0 个答案:

没有答案