more-css and less are bundled into this gulp plugin.
Less provides more flexible syntax than the traditional CSS syntax. Less's documentations and tutorials can be found here: http://lesscss.org/
more-css is a minifying css tool. It by far has the best performance among other minifying tools. Benhcmark can be found here: http://goalsmashers.github.io/css-minification-benchmark/
npm install gulp-more-less
moreLess({
[less],
[lessOpts: { [sourceMap], [sourceMapPath], [sourceMapFileInline] },
[more]]
})
If you do not pass any argument, the plug-in does nothing.
If true, the content of the file will be compiled with less compiler.
If true, the content of the file will be minified with more-css.
This defines some options for Less.
If true, the plugin will produce the soure map.
This is the directory to save the source map files.
Set to true if you want to put the source map inside the output css file.
var moreLess = require("gulp-more-less")
var gulp = require("gulp")
gulp.task('test_less_more', function() {
gulp.src("*.less")
.pipe(moreLess({less:true, more:true}))
.pipe(gulp.dest("./build"))
})
gulp.task('test_src_map_inline', function() {
gulp.src("*.less")
.pipe(moreLess({less:true,lessOpts: {sourceMap: true, sourceMapFileInline: true}}))
.pipe(gulp.dest("./build"))
})
gulp.task('test_src_map_path', function() {
gulp.src("*.less")
.pipe(moreLess({less:true,lessOpts: {sourceMap: true, sourceMapPath: "./build" }}))
.pipe(gulp.dest("./build"))
})