我想用grunt自动编译一个CSS文件。这是我的咕unt声文件。我收到此错误:
运行“ sass:dist”(sass)任务警告:“ path”参数必须为 字符串类型。收到未定义的使用--force继续。
Gruntfile.js
module.exports = function(grunt) {
grunt.initConfig({
sass: { // Task
dist: { // Target
options: { // Target options
style: 'compressed'
},
files: {
'/static/css/main.css': '/static/css/main.scss', // 'destination': 'source'
//'widgets.css': 'widgets.scss'
}
}
},
watch: {
sass:{
files: ['/static/css/*.scss'],
tasks: ['sass:dist'],
}
}
});
grunt.loadNpmTasks('grunt-contrib-sass');
grunt.loadNpmTasks('grunt-contrib-watch');
grunt.registerTask('default', ['sass:dist']);
};
我的json包是这样的,我在我的机器上安装了ruby:
package.json
{
"name": "grunt-crm1",
"version": "1.0.0",
"author": "Gregor",
"devDependencies": {
"grunt": "^1.0.1",
"grunt-contrib-watch": "^1.1.0",
"grunt-contrib-sass": "^1.0.0"
},
"dependencies": {}
}