-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgulpfile.js
35 lines (31 loc) · 1 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
'use strict';
var gulp = require('gulp');
var sass = require('gulp-sass')(require('sass'));
var rename = require('gulp-rename');
var uglify = require('gulp-uglify');
var replace = require('gulp-replace');
//var cssnano = require('gulp-cssnano');
gulp.task('build:sass', function () {
return gulp.src('./src/*.scss')
.pipe(sass().on('error', sass.logError))
//.pipe(cssnano())
//.pipe(rename({ suffix: '.min' }))
.pipe(gulp.dest('./dist'));
});
gulp.task('sass:watch', function () {
gulp.watch('./src/*.scss', ['build:sass']);
});
gulp.task('build:js', function () {
return gulp.src('src/*.js')
.pipe(rename({ suffix: '.min' }))
.pipe(uglify())
.pipe(replace('setChangeProgressHandler', 'sCPH'))
.pipe(replace('setClickHandler', 'sCH'))
.pipe(replace('hideProgressTimeHint', 'hPTH'))
.pipe(replace('setCurrentTime', 'sCT'))
.pipe(replace('setProgress', 'sP'))
.pipe(replace('getState', 'gS'))
.pipe(replace('setEndTime', 'sET'))
.pipe(replace('setBuffer', 'sB'))
.pipe(gulp.dest('dist'));
});