Grunt watch 编译了我的 LESS 文件,但没有生成 CSS 文件。我不知道问题是什么。有人可以帮忙吗?
这是我的咕噜声代码:
module.exports = function(grunt) {
grunt.loadNpmTasks('grunt-contrib-less');
grunt.loadNpmTasks('grunt-contrib-watch');
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
less: {
options: {
paths: 'less',
yuicompress: true
},
files: {
'styles.css': 'less/button.less'
}
},
watch: {
less: {
files: 'less/*.less',
tasks: 'less'
}
}
});
}
这是我的package.json
代码:
{
"name": "project-name",
"version": "1.0.0",
"description": "Awesome project",
"devDependencies": {
"grunt-contrib-less": "^1.4.1",
"grunt-contrib-watch": "^1.0.0"
}
}
请参阅下面的文件夹结构:
Grunt Watch 工作正常: