我正在使用Grunt将通过监视将我的SASS文件转换为CSS。使用Grunt Watch将SASS转换为CSS致命错误
的事情是:我可以normaly运行北斗任务时,CSS创建的非常好,但是当我使用WATCH我得到了错误:
grunt.util._.contains is not a function
这里是我的package.json
:
{
"name": "myName",
"description": "myDesc",
"author": "mySelf",
"version": "0.0.1",
"private": true,
"devDependencies": {
"grunt": "^1.0.1",
"grunt-contrib-compass": "^1.1.1",
"grunt-contrib-jshint": "^0.10.0",
"grunt-contrib-nodeunit": "~0.4.1",
"grunt-contrib-sass": "^1.0.0",
"grunt-contrib-uglify": "^0.5.1",
"grunt-contrib-watch": "^0.4.4"
}
}
这里是我的Gruntfile.js
:
module.exports = function(grunt) {
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
compass: {
dist: {
options: {
config: 'config.rb'
}
}
},
watch: {
css: {
files: 'assets/**/*.{scss,sass}',
tasks: ['compass']
}
}
});
grunt.loadNpmTasks('grunt-contrib-compass');
grunt.loadNpmTasks('grunt-contrib-watch');
grunt.registerTask('default',['compass','watch']);
};
我尝试了很多的变化,但没有什么帮助
Update!
After a long night, solve the problem... Please read my own answer