-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathold_gulpfile.js
43 lines (38 loc) · 1.33 KB
/
old_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
40
41
42
43
var gulp = require('gulp');
var sass = require('gulp-sass');
var please = require('gulp-pleeease');
var watch = require('gulp-watch');
var plumber = require('gulp-plumber');
var notify = require('gulp-notify');
gulp.task('default', ['sass', 'pleeease']);// par défaut utilise 2 fonction sass et pleeease
gulp.task('sass', function () {
gulp.src(['scss/*.scss', '!scss/mixins.scss'])
.pipe(watch('scss/*.scss'))
.pipe(plumber())
.pipe(sass({errLogToConsole: true}))
.pipe(gulp.dest('scss/tmp-sassed'))
.pipe(notify({message: 'SASS task complete'}));
});
var PleeeaseOptions = {
optimizers: {
"autoprefixer": { "browsers": ["Firefox 25", "Chrome 21", "Android 4"]}
}
};
gulp.task('pleeease', function () {
gulp.src('scss/tmp-sassed/*.css')
.pipe(watch('scss/tmp-sassed/*.css'))
.pipe(plumber())
.pipe(please(
PleeeaseOptions
))
.pipe(gulp.dest('./css'))
.pipe(notify({message: 'Pleeease task complete'}));
});
gulp.task('watch', function() {
gulp.watch('scss/*.scss',['sass', 'pleeease']).on('change', function(event){
console.log('Le fichier ' + event.path + ' a ete modifie');
})
gulp.watch('css/*.css').on('change', function(event){
console.log('Le fichier ' + event.path + ' a ete modifie');
})
});