Grunt Watch不再工作了

时间:2015-04-21 13:26:22

标签: gruntjs watch

我试图找出为什么我的JS没有被grunt编译,所以我编辑了gruntfile.js。然后咕噜咕噜的停下来。我已经尝试用git恢复文件,我已经安装了npm,试图看看是否有帮助......有没有人看到我的gruntfile有问题?或者可能有其他可能的解决方案?

 module.exports = function(grunt){
 grunt.loadNpmTasks('grunt-contrib-uglify');
 grunt.loadNpmTasks('grunt-contrib-watch');
 grunt.loadNpmTasks('grunt-contrib-compass');

 grunt.initConfig({
 uglify:{
    my_target: {
        files: {
            'js/script.js': ['_/js/*.js']

        }//files
    }//target
},//uglify
compass:{
    dev:{
        options: {
            config:'config.rb'
        }//options
    }//dev
}, //compass
watch: {
    options:{ livereload: true },
    scripts: {
        files: ['_/js/*.js'],
        tasks: ['uglify']

    },
    sass: {
        files:['_/sass/*.scss'],
        tasks: ['compass:dev']
    }//sass

    //scripts
    // html: {
    //  files: ['*.html']
    // } //for auto refresh browser, need script on html as well.
}//watch


  })//initConfig
  grunt.registerTask('default','watch') //run gunt and wait for changes

 }//exports

这是我的package.json依赖项

"dependencies" : {
    "grunt" : "~0.4.5",
    "grunt-contrib-watch" : "~0.6.1",
    "grunt-contrib-compass" : "~1.0.3",
    "grunt-contrib-uglify" : "~0.9.1",
    "matchdep" : "~0.3.0"
}

0 个答案:

没有答案