forked from alsacreations/KNACSS
-
Notifications
You must be signed in to change notification settings - Fork 0
/
gulpfile.js
39 lines (34 loc) · 1.05 KB
/
gulpfile.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
// Requires
var gulp = require('gulp');
// Include plugins
var minifycss = require('gulp-minify-css');
var sourcemaps = require('gulp-sourcemaps');
var postcss = require('gulp-postcss');
var selector = require('postcss-custom-selectors');
var calc = require("postcss-calc");
var cssnext = require('cssnext');
var rename = require('gulp-rename');
// Common tasks
gulp.task('doallthethings', ['styles-next']);
// Styles NEXT
gulp.task('styles-next', function () {
var processors = [
selector(),
calc(),
cssnext()
];
gulp.src("next/knacss.css")
.pipe(postcss(processors))
.pipe(sourcemaps.init())
.pipe(rename('knacss-unminified.css'))
.pipe(gulp.dest('./css'))
.pipe(rename('knacss.css'))
.pipe(minifycss({keepBreaks:false,keepSpecialComments:0}))
.pipe(sourcemaps.write('.', {includeContent: false}))
.pipe(gulp.dest('./css'));
});
// Watcher
gulp.task('watch', function() {
gulp.watch(['./next/*.css'], ['styles-next']);
});
gulp.task('default', ['doallthethings']);