grunt watch命令不起作用

时间:2014-09-05 10:41:27

标签: gruntjs less watch

我的grunt watch任务正在运行,但无法识别.less文件中的任何更改: 这是我的grunt file.js:

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的手动触发工作正常。

0 个答案:

没有答案