Gruntjs 咕噜手表不是';我不再工作了
我试图弄清楚为什么grunt没有编译我的JS,所以我编辑了gruntfile.JS。然后,咕哝的手表停了下来。我已经试着用git还原文件,我已经安装了npm,试图看看这是否有帮助。。。有人看到我的Grunfile有问题吗?或者有其他可能的解决办法Gruntjs 咕噜手表不是';我不再工作了,gruntjs,watch,Gruntjs,Watch,我试图弄清楚为什么grunt没有编译我的JS,所以我编辑了gruntfile.JS。然后,咕哝的手表停了下来。我已经试着用git还原文件,我已经安装了npm,试图看看这是否有帮助。。。有人看到我的Grunfile有问题吗?或者有其他可能的解决办法 module.exports = function(grunt){ grunt.loadNpmTasks('grunt-contrib-uglify'); grunt.loadNpmTasks('grunt-contrib-watch'); g
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"
}
我解决了grunt不工作选项的问题:{livereload:true,},在true之后需要一个逗号。。。有人知道为什么我的脚本没有编译吗?现在它开始工作了。这是关闭的。。。显然,我的一个js文件中有一个错误的调用。