Compile LESS files with source maps

后端 未结 3 1655
一整个雨季
一整个雨季 2020-12-10 02:51

How can I compile a LESS file to output a source map file (.css.map) in addition to a CSS file? Is there a way to do it on both command line (NodeJS\'s le

3条回答
  •  感动是毒
    2020-12-10 03:32

    If the command line doesn't suite you, Grunt is great at this type of thing. You can configure the grunt-contrib-less plugin to generate inline maps with a config like this:

     less: {
            options: {
                sourceMap:true,
                outputSourceFiles: true
            },
            lessFiles: {
                expand: true,
                flatten:false,
                src: ['**/*.less'],
                dest: ['dist/'],
                ext: '.css',
            }
        },
    

    https://github.com/gruntjs/grunt-contrib-less

提交回复
热议问题