forked from nozzle/nzTour
-
Notifications
You must be signed in to change notification settings - Fork 0
/
gulpfile.js
49 lines (41 loc) · 1.16 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
var gulp = require('gulp');
var rename = require('gulp-rename');
var uglify = require('gulp-uglifyjs');
var stylus = require('gulp-stylus');
var ngAnnotate = require('gulp-ng-annotate');
var nib = require('nib');
var config;
gulp.task('stylus', stylusTask);
gulp.task('js', jsTask);
gulp.task('watch', watchTask);
gulp.task('build', ['stylus', 'js']);
gulp.task('default', ['build', 'watch']);
function stylusTask() {
gulp.src('./src/nz-tour.styl')
.pipe(stylus({
use: [nib()],
compress: false,
}))
.pipe(rename("nz-tour.css"))
.pipe(gulp.dest('./dist/'));
return gulp.src('./src/nz-tour.styl')
.pipe(stylus({
use: [nib()],
compress: true,
}))
.pipe(rename("nz-tour.min.css"))
.pipe(gulp.dest('./dist/'));
}
function jsTask() {
gulp.src('./src/nz-tour.js')
.pipe(ngAnnotate())
.pipe(uglify())
.pipe(rename('nz-tour.min.js'))
.pipe(gulp.dest('./dist/'));
return gulp.src('./src/nz-tour.js')
.pipe(ngAnnotate())
.pipe(gulp.dest('./dist/'));
}
function watchTask() {
gulp.watch('./src/**', ['build']);
}