Grunt 0.4 less task : How to not concatenate destination files

后端 未结 2 969
南笙
南笙 2021-01-01 05:11

I want to generate .css partial files from the corresponding .less files

I use the latest versions available from npm, grunt@0.4.0, grunt-contrib-less@0.5.0

2条回答
  •  春和景丽
    2021-01-01 05:36

    You'd want to read the Building the files object dynamically section in the docs.

    This would be a direct translation from your current config:

    module.exports = function (grunt) {
        grunt.initConfig({
            less: {
                development: {
                    files: [{
                        expand: true,        // Enable dynamic expansion.
                        cwd: 'htdocs/less',  // Src matches are relative to this path.
                        src: ['*.less'],     // Actual pattern(s) to match.
                        dest: 'htdocs/css',  // Destination path prefix.
                        ext: '.css',         // Dest filepaths will have this extension.
                    }]
                }
            },
        });
    };
    

提交回复
热议问题