@lernetz/gulp-stylus

0.1.1 • Public • Published

@lernetz/gulp-stylus

A Gulp task that compiles Stylus files, applies the Autoprefixer PostCSS processor, generates sourcemaps and a minified version.

Usage

The following example will compile all the files referenced by stylus/main.styl and produce a bundle in the output folder public, using the base file name demo:

const gulp = require('gulp');
const cssTask = require('@lernetz/gulp-stylus');

gulp.task('css', cssTask({ src:'stylus/main.styl', dest: 'public', name: 'demo' }));

This task will create the following files:

  • public/demo.css - non-minified .css bundle including the sourcemap definition
  • public/demo.min.css - minified .css bundle

Options

The task accepts a parameter object with the following attributes:

{
    name: 'name', // the file name of the generated files
    src: 'src/**.ts', // the source parameter for the gulp.src( .. )
    dest: 'public', // the destination used in gulp.dest( .. )
    stylus: {}, // options for the stylus compiler used in gulp-stylus: https://www.npmjs.com/package/gulp-stylus#options
    prefixer: { cascade: true } // options for the gulp-autoprefixer: https://github.com/sindresorhus/gulp-autoprefixer#options
}

Package Sidebar

Install

npm i @lernetz/gulp-stylus

Weekly Downloads

0

Version

0.1.1

License

MIT

Unpacked Size

4.54 kB

Total Files

4

Last publish

Collaborators

  • lernetz-mich
  • stakx