Gruntjs 咕噜声监视命令不工作
我的grunt watch任务正在运行,但无法识别.less文件中的任何更改: 这是我的grunt file.js:Gruntjs 咕噜声监视命令不工作,gruntjs,less,watch,Gruntjs,Less,Watch,我的grunt watch任务正在运行,但无法识别.less文件中的任何更改: 这是我的grunt file.js: module.exports = function(grunt) { grunt.initConfig({ // running `grunt less` will compile once less: { development: { options: {
module.exports = function(grunt) {
grunt.initConfig({
// running `grunt less` will compile once
less: {
development: {
options: {
compress: false,
yuicompress: false,
},
files: {
"public/css/styles.css": "src/less/styles.less"
}
},
production: {
options: {
compress: true,
yuicompress: true,
optimization: 2,
},
files: {
"public/css/styles.min.css": "src/less/styles.less"
}
}
},
// running `grunt watch` will watch for changes
watch: {
files: "src/less/*.*/*.less",
tasks: ["less"]
}
});
grunt.loadNpmTasks('grunt-contrib-less');
grunt.loadNpmTasks('grunt-contrib-watch');
grunt.registerTask('default', ['watch']);
};
谁能给我一个提示吗。手动触发grunt less工作正常。
文件:“src/less/*.*/*.less”
-这看起来不是less文件的正确模式。应该是“src/less/*.less”
或“src/less/***/.less”
或“src/less/{,*/}.less”
或类似的内容,这取决于文件的实际位置(那些位于主样式.less
旁边的文件)。谢谢。我的../*.*/..
在子文件夹中查找时出错。你的暗示解决了这个问题。