gulp-pleeease
v2.0.2
Published
Postprocess CSS with ease.
Downloads
2,085
Readme
gulp-pleeease
Gulp plugin for pleeease
See pleeease.io for documentation.
Install
npm install --save-dev gulp-pleeease
Example
var gulp = require('gulp');
var pleeease = require('gulp-pleeease');
gulp.task('css', function () {
gulp.src('./src/*.css')
.pipe(pleeease())
.pipe(rename({
suffix: '.min',
extname: '.css'
}))
.pipe(gulp.dest('./dest'));
});
You can also use out
option (and it's preferable for good sourcemaps):
gulp.task('css', function () {
gulp.src('./src/*.css')
.pipe(pleeease({
out: 'out.min.css'
}))
.pipe(gulp.dest('./dest'));
});
Preprocessors support
As simple as it looks, no need for specific gulp modules:
var gulp = require('gulp');
var pleeease = require('gulp-pleeease');
gulp.task('css', function () {
gulp.src('./src/*.scss')
.pipe(pleeease({
sass: true
}))
.pipe(gulp.dest('./dest'));
});
Or maybe, if you have imports:
var gulp = require('gulp');
var pleeease = require('gulp-pleeease');
gulp.task('css', function () {
gulp.src('./src/*.scss')
.pipe(pleeease({
sass: {
includePaths: ['path/to/include']
}
}))
.pipe(gulp.dest('./dest'));
});
You can use Sass, LESS or Stylus.
Source map support
Using gulp-sourcemaps. To get good sourcemaps, you should always specify base
option in gulp.src
. You will get inline sourcemaps.
var gulp = require('gulp');
var pleeease = require('gulp-pleeease');
var sourcemaps = require('gulp-sourcemaps');
gulp.task('css', function () {
gulp.src('./src/*.css', {base: '.'})
.pipe(sourcemaps.init())
.pipe(pleeease())
.pipe(sourcemaps.write())
.pipe(gulp.dest('./dest'));
});
And even with preprocessors. Here, using Stylus, and with sourcemaps as a separate file:
var gulp = require('gulp');
var pleeease = require('gulp-pleeease');
var sourcemaps = require('gulp-sourcemaps');
gulp.task('css', function () {
gulp.src('./src/*.styl', {base: '.'})
.pipe(sourcemaps.init())
.pipe(pleeease({
stylus: {
paths: ['path/to/include']
}
}))
.pipe(sourcemaps.write('.'))
.pipe(gulp.dest('./dest'));
});
Options
Same as pleeease
License
MIT © Daniel Husar