Skip to content

A simplified, standardized, gulp-compatible build script to bundle a source file using LESS, Autoprefixer, and CSSMin

License

Notifications You must be signed in to change notification settings

jmfirth/gulp-less-build

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

GeekHive Gulp LESS Build

A simplified, standardized, gulp-compatible build script to bundle a source file using LESS, Autoprefixer, and CSSMin

Installation

Using NPM

npm install geekhive/gulp-less-build --save-dev

Using yarn

yarn add geekhive/gulp-less-build --dev

Usage

Require @geekhive/gulp-less-build to access the build class.

const LESSBuild = require('@geekhive/gulp-less-build');

new LESSBuild(src, dest, gulp)

Create a new LESSBuild object by passing it source and destination paths for the file to compile as well as a reference to gulp.

const css = new LESSBuild(
    `${__dirname}/assets/less/site.less`,
    `${__dirname}/assets/css/site.min.css`,
    gulp);

The dest argument may also be an array of destinations.

const css = new LESSBuild(
    `${__dirname}/assets/less/site.less`,
    [
        `${__dirname}/assets/css/site.min.css`,
        `${__dirname}/assets/example/alternative.css`
    ],
    gulp);

LESSBuild#build()

The LESSBuild#build method can be passed directly to gulp as a build task:

gulp.task('build:css', css.build);

Calling css.build will compile the source less file using LESS, Autoprefixer, and CSSMin. It will then output the result to the destination location.

LESSBuild#watch()

The LESSBuild#watch method can be passed directly to gulp as a watch task:

gulp.task('watch:css', css.watch);

Calling css.watch will start watching the source directory and subdirectories for changes and will recompile the CSS file when changes are made.

About

A simplified, standardized, gulp-compatible build script to bundle a source file using LESS, Autoprefixer, and CSSMin

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • JavaScript 100.0%