0.1.1 • Published 7 years ago
@lernetz/gulp-stylus v0.1.1
@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.cssbundle including the sourcemap definitionpublic/demo.min.css- minified.cssbundle
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
}