{"id":41201,"library":"gulp-less","title":"gulp-less","description":"A LESS plugin for Gulp that compiles Less files into CSS. Currently at version 5.0.0, it supports Less 3.7+ and 4.0+, and requires Node >=6. It integrates with Gulp streams, allows custom include paths and Less plugins, and works alongside gulp-sourcemaps for source map generation. Unlike other LESS processors, it is designed specifically for the Gulp build system, leveraging its streaming pipeline for efficient asset processing.","status":"active","version":"5.0.0","language":"javascript","source_language":"en","source_url":"git://github.com/gulp-community/gulp-less","tags":["javascript","gulpplugin","gulp","less"],"install":[{"cmd":"npm install gulp-less","lang":"bash","label":"npm"},{"cmd":"yarn add gulp-less","lang":"bash","label":"yarn"},{"cmd":"pnpm add gulp-less","lang":"bash","label":"pnpm"}],"dependencies":[{"reason":"Core Less compiler runtime","package":"less","optional":false}],"imports":[{"note":"CommonJS require is the standard. If using ESM, use default import from the CommonJS module via bundler or Node --experimental-require-module.","wrong":"import * as less from 'gulp-less'; // requires ESM setup","symbol":"Default (function)","correct":"const less = require('gulp-less');"},{"note":"Options like `compress` are not supported; use a CSS minifier instead.","wrong":"less({ compress: true }) // compress removed","symbol":"Less options","correct":"less({ paths: ['path/to/includes'], plugins: [pluginObj] })"},{"note":"Directly pipe the less function; no need to call it with .call().","wrong":"gulp.src('src/**/*.less').pipe(require('gulp-less').call()) // unnecessary","symbol":"gulp.src piping","correct":"gulp.src('src/**/*.less').pipe(less())"}],"quickstart":{"code":"const gulp = require('gulp');\nconst less = require('gulp-less');\nconst path = require('path');\n\ngulp.task('less', function () {\n  return gulp.src('./src/less/**/*.less')\n    .pipe(less({\n      paths: [ path.join(__dirname, 'src', 'less', 'includes') ]\n    }))\n    .pipe(gulp.dest('./dist/css'));\n});","lang":"javascript","description":"Compile all .less files from src/less into CSS, with custom include paths for @import resolution."},"warnings":[{"fix":"Remove `compress` option and pipe through a CSS minifier plugin.","message":"The `compress` option is not supported. Use a CSS minifier like gulp-clean-css.","severity":"gotcha","affected_versions":"*"},{"fix":"Initialize sourcemaps before less() and write after, not via Less sourceMap option.","message":"Source maps must be generated via gulp-sourcemaps, not via Less options.","severity":"gotcha","affected_versions":"*"},{"fix":"Remove any manual `filename` option from less() call.","message":"The `filename` option is handled automatically; do not set it manually.","severity":"gotcha","affected_versions":"*"},{"fix":"Migrate tasks to Gulp 4's exported function pattern: exports.less = () => ...","message":"Gulp 3.x is deprecated; use Gulp 4+ with gulp.series or gulp.parallel.","severity":"deprecated","affected_versions":">=5"}],"env_vars":null,"search_vec":"'3.7':22 '4.0':24 '5.0.0':18 '6':28 'allow':34 'alongsid':43 'asset':70 'build':62 'compil':10 'css':14 'current':15 'custom':35 'design':57 'effici':69 'file':12 'generat':50 'gulp':2,8,32,45,61,74 'gulp-less':1 'gulp-sourcemap':44 'gulpplugin':73 'includ':36 'integr':30 'javascript':72 'less':3,5,11,21,39,53,75 'leverag':64 'map':49 'node':27 'path':37 'pipelin':67 'plugin':6,40 'process':71 'processor':54 'requir':26 'sourc':48 'sourcemap':46 'specif':58 'stream':33,66 'support':20 'system':63 'unlik':51 'version':17 'work':42","created_at":"2026-06-04T18:51:15.791902+00:00","updated_at":"2026-06-04T18:51:15.791902+00:00","problems":[{"fix":"Remove `filename` option from less() call.","cause":"User sets `filename` in options (handled automatically).","error":"Error: `gulp-less` error: `filename` option is not supported"},{"fix":"Check Less version compatibility; use only supported options: `paths`, `plugins`, and Less 4 options.","cause":"Passing invalid options, possibly `compress` or old Less options.","error":"TypeError: Cannot read property 'apply' of undefined"}],"ecosystem":"npm","meta_description":null,"install_score":null,"quickstart_score":null,"quickstart_tag":null,"pypi_latest":null,"cli_name":null,"cli_version":null,"type":"library","homepage":"https://github.com/gulp-community/gulp-less#readme","github":"git://github.com/gulp-community/gulp-less","docs":null,"changelog":null,"pypi":null,"npm":"gulp-less","openapi_spec":null,"status_page":null,"smithery":null,"categories":["devops"],"base_url":null,"auth_type":null,"provenance":{"verified_status":null,"verified_at":null,"last_verified":"2026-06-04","next_check":"2026-09-02","install_tag":null}}