我使用节点、js和*.less将*.css文件编译成*.css文件,然后我需要更改属性的顺序并创建最终的css文件,为此我尝试使用格伦茨梳。
我的Gruntfile.js
module.exports = function (grunt) {
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
less: {
development: {
options: {
compress: false
},
files: {
"css/unsorted_style.css": "less/style.less"
}
}
},
csscomb: {
foo: {
files: {
'css/style.css': ['css/unsorted_style.css']
}
}
},
watch: {
less: {
files: ['less/*.less'],
tasks: ['less'],
options: {
spawn: false
}
},
css {
files: ['css/unsorted_style.css'],
tasks: ['css', 'csscomb'],
options: {
spawn: false
}
}
}
});
grunt.loadNpmTasks('grunt-contrib-less');
grunt.loadNpmTasks('grunt-csscomb');
grunt.loadNpmTasks('grunt-contrib-watch');
grunt.registerTask('default', ['less', 'csscomb', 'watch']);
};但我犯了个错误

怎么了?怎么修呢?
发布于 2015-07-11 18:06:43
你错过了: in css
module.exports = function (grunt) {
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
less: {
development: {
options: {
compress: false
},
files: {
"css/unsorted_style.css": "less/style.less"
}
}
},
csscomb: {
foo: {
files: {
'css/style.css': ['css/unsorted_style.css']
}
}
},
watch: {
less: {
files: ['less/*.less'],
tasks: ['less'],
options: {
spawn: false
}
},
css: {
files: ['css/unsorted_style.css'],
tasks: ['css', 'csscomb'],
options: {
spawn: false
}
}
}
});
grunt.loadNpmTasks('grunt-contrib-less');
grunt.loadNpmTasks('grunt-csscomb');
grunt.loadNpmTasks('grunt-contrib-watch');
grunt.registerTask('default', ['less', 'csscomb', 'watch']);
};https://stackoverflow.com/questions/31360118
复制相似问题