forked from mozilla/popcorn-editor
-
Notifications
You must be signed in to change notification settings - Fork 2
/
gulpfile.js
38 lines (31 loc) · 1.03 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
var gulp = require('gulp'),
less = require('gulp-less'),
clean = require('gulp-rimraf'),
rename = require ('gulp-rename');
gulp.task('less-templates', function () {
return gulp.src('PopcornEditor/templates/basic/style.less')
.pipe(less())
.pipe(gulp.dest('PopcornEditor/templates/basic/'));
});
gulp.task('less-src', function () {
return gulp.src('PopcornEditor/css/butter.ui.less')
.pipe(less())
.pipe(rename(function (path) {
path.extname = '.less.css';
}))
.pipe(gulp.dest('PopcornEditor/css'));
});
gulp.task('less', ['less-templates', 'less-src'], function () {});
gulp.task('clean', function () {
return gulp.src([
'PopcornEditor/css/butter.ui.less.css',
'PopcornEditor/templates/basic/*.css'
])
.pipe(clean());
});
gulp.task('watch', ['clean'], function () {
gulp.watch('PopcornEditor/templates/basic/*.less', ['less-templates']);
gulp.watch('PopcornEditor/css/*.less', ['less-src']);
})
gulp.task('default', ['clean', 'less', 'watch']);
gulp.task('build', ['clean', 'less']);