2015-04-14 10:04:17 +02:00
|
|
|
// Requires
|
|
|
|
var gulp = require('gulp');
|
|
|
|
|
|
|
|
// Include plugins
|
|
|
|
var less = require('gulp-less');
|
|
|
|
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');
|
2015-04-14 10:04:17 +02:00
|
|
|
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 () {
|
2015-04-14 10:04:17 +02:00
|
|
|
return gulp.src('./less/knacss.less')
|
|
|
|
.pipe(less())
|
|
|
|
.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}))
|
2015-04-14 10:04:17 +02:00
|
|
|
.pipe(gulp.dest('./css/'));
|
|
|
|
});
|
|
|
|
|
2015-12-24 11:16:13 +01:00
|
|
|
gulp.task('grillade-less', function() {
|
2015-12-24 09:04:43 +01:00
|
|
|
return gulp.src(['./less/_00-config.less', './less/_03-grids.less'])
|
|
|
|
.pipe(concat('grillade.less'))
|
2015-12-24 11:16:13 +01:00
|
|
|
.pipe(gulp.dest('./css/'))
|
2015-12-24 09:04:43 +01:00
|
|
|
.pipe(less())
|
|
|
|
.pipe(autoprefixer())
|
|
|
|
.pipe(minifycss())
|
|
|
|
.pipe(gulp.dest('./css/'));
|
|
|
|
});
|
2015-12-24 11:16:13 +01:00
|
|
|
gulp.task('grillade-sass', function() {
|
|
|
|
return gulp.src(['./sass/_00-config.scss', './sass/_03-grids.scss'])
|
|
|
|
.pipe(concat('grillade.scss'))
|
|
|
|
.pipe(gulp.dest('./css/'));
|
|
|
|
});
|
2015-12-24 09:04:43 +01:00
|
|
|
|
2015-04-14 10:04:17 +02:00
|
|
|
// Watcher
|
|
|
|
gulp.task('watch', function() {
|
2015-06-26 14:34:58 +02:00
|
|
|
gulp.watch(['./less/*.less'], ['css']);
|
2015-04-14 10:04:17 +02:00
|
|
|
});
|
|
|
|
|
2015-12-24 11:16:13 +01:00
|
|
|
gulp.task('grillade', ['grillade-less', 'grillade-sass']);
|
|
|
|
|
2015-07-02 09:31:17 +02:00
|
|
|
gulp.task('default', ['css']);
|