gulp-pleeease
Gulp plugin for pleeease
See pleeease.io for documentation.
npm install --save-dev gulp-pleeease
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'));
});
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.
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'));
});
Same as pleeease
MIT © Daniel Husar