KNACSS/gulpfile.js

46 lines
1.2 KiB
JavaScript
Raw Permalink Normal View History

// Requires
var gulp = require('gulp');
// Include plugins
2016-05-16 15:45:14 +02:00
var sass = require('gulp-sass');
var concat = require('gulp-concat');
var rename = require('gulp-rename');
var minifycss = require('gulp-minify-css');
2015-07-08 09:53:24 +02:00
// var sourcemaps = require('gulp-sourcemaps');
var autoprefixer = require('gulp-autoprefixer');
2015-06-26 14:34:58 +02:00
// tâche CSS = compile vers knacss.css et knacss-unminified.css
gulp.task('css', function () {
2016-05-16 15:45:14 +02:00
return gulp.src('./sass/knacss.scss')
2017-02-06 23:16:28 +01:00
.pipe(sass({
outputStyle: 'expanded' // CSS non minifiée plus lisible ('}' à la ligne)
}))
.pipe(autoprefixer())
.pipe(rename('knacss-unminified.css'))
.pipe(gulp.dest('./css/'))
.pipe(rename('knacss.css'))
2015-07-08 09:53:24 +02:00
//.pipe(sourcemaps.init())
2015-07-02 09:31:17 +02:00
.pipe(minifycss())
2015-07-08 09:53:24 +02:00
//.pipe(sourcemaps.write('.', {includeContent: false}))
.pipe(gulp.dest('./css/'));
});
gulp.task('grillade', function() {
2016-09-21 11:05:00 +02:00
return gulp.src(['./sass/_config/_breakpoints.scss', './sass/grids/_grillade.scss'])
2016-05-16 15:45:14 +02:00
.pipe(concat('grillade.scss'))
2015-12-24 11:16:13 +01:00
.pipe(gulp.dest('./css/'))
2016-05-16 15:45:14 +02:00
.pipe(sass())
2015-12-24 09:04:43 +01:00
.pipe(autoprefixer())
.pipe(minifycss())
.pipe(gulp.dest('./css/'));
});
// Watcher
gulp.task('watch', function() {
2016-05-16 15:45:14 +02:00
gulp.watch(['./sass/*.scss'], ['css']);
});
2015-12-24 11:16:13 +01:00
2015-07-02 09:31:17 +02:00
gulp.task('default', ['css']);