forked from mozilla/masterfirefoxos
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgulpfile.js
54 lines (43 loc) · 1.34 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
39
40
41
42
43
44
45
46
47
48
49
50
var gulp = require('gulp');
var gulpFilter = require('gulp-filter');
var concat = require('gulp-concat');
var stylus = require('gulp-stylus');
var sourcemaps = require('gulp-sourcemaps');
var del = require('del');
var paths = {
stylus: './masterfirefoxos/base/static/stylus',
css: './masterfirefoxos/base/static/css/'
};
gulp.task('compress:base', function () {
return gulp.src(paths.stylus + '/base.styl')
.pipe(sourcemaps.init())
.pipe(stylus({compress: true}))
.pipe(concat('base.css'))
.pipe(sourcemaps.write('.'))
.pipe(gulp.dest(paths.css));
});
gulp.task('compress:home', function () {
return gulp.src(paths.stylus + '/home.styl')
.pipe(sourcemaps.init())
.pipe(stylus({compress: true}))
.pipe(concat('home.css'))
.pipe(sourcemaps.write('.'))
.pipe(gulp.dest(paths.css));
});
gulp.task('compress:ie', function () {
return gulp.src(paths.stylus + '/oldIE.styl')
.pipe(sourcemaps.init())
.pipe(stylus({compress: true}))
.pipe(sourcemaps.write('.'))
.pipe(gulp.dest(paths.css));
});
gulp.task('clean:css', function (cb) {
return del([
paths.css + '/*',
'!' + paths.css + '/README.md'
], cb);
});
gulp.task('watch:css', function() {
gulp.watch(paths.stylus + '/**/*.styl', ['default']);
});
gulp.task('default', ['clean:css', 'compress:base', 'compress:home', 'compress:ie']);