grunt less 入门

杨晟
2023-12-01
将src 文件夹下的所有.less 文件  执行less编译后放置到 output 文件夹下
 
grunt-contrib-less
files 参数是grunt 公共的,其中ext是生成文件的扩展名
 
module.exports = function (grunt) {
    grunt.initConfig({
        pkg: grunt.file.readJSON('package.json'),
        less: {
            lessall: {
                files: [{
                    expand:true,
                    cwd:'src',
                    src:'**/*.less',
                    dest: 'output/',
                    ext: '.css'
                }]
            }
        }
    });
    grunt.loadNpmTasks('grunt-contrib-less');
};
 类似资料: