-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathgulpfile.js
37 lines (29 loc) · 1.02 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
'use strict';
var gulp = require('gulp');
var less = require('gulp-less');
var sourcemaps = require('gulp-sourcemaps');
var cleanCSS = require('gulp-clean-css');
var rename = require('gulp-rename');
var runSequence = require('run-sequence');
gulp.task('less', function () {
return gulp.src('./assets/less/django-translation-flags.less')
.pipe(sourcemaps.init())
.pipe(less())
.pipe(sourcemaps.write())
.pipe(gulp.dest('./django-translation-flags/static/css'));
});
gulp.task('minify-css', function() {
return gulp.src(['./django-translation-flags/static/css/django-translation-flags.css'])
.pipe(cleanCSS({compatibility: 'ie8'}))
.pipe(rename({
suffix: '.min'
}))
.pipe(gulp.dest('./django-translation-flags/static/css'))
});
gulp.task('watch', function () {
gulp.watch('./assets/less/*.less', ['less']);
gulp.watch('./django-translation-flags/static/css/django-translation-flags.css', ['minify-css']);
});
gulp.task('dev', function(){
runSequence('less', 'minify-css', 'watch')
})