forked from CymChad/BaseRecyclerViewAdapterHelper
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathgulpfile.js
More file actions
63 lines (53 loc) · 1.64 KB
/
gulpfile.js
File metadata and controls
63 lines (53 loc) · 1.64 KB
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
51
52
53
54
55
56
57
58
59
60
61
62
// import gulp from 'gulp';
// import sass from 'gulp-sass';
// import imagemin from 'gulp-imagemin';
// import autoprefixer from 'gulp-autoprefixer';
// import notify from 'gulp-notify';
// import livereload from 'gulp-livereload';
// import del from 'del';
var gulp = require('gulp'),
sass = require('gulp-sass'),
imagemin = require('gulp-imagemin'),
autoprefixer = require('gulp-autoprefixer'),
connect = require('gulp-connect'),
uglify = require('gulp-uglify'),
del = require('del'),
pngquant = require('imagemin-pngquant'),
cache = require('gulp-cache');
gulp.task('styles', function () {
return gulp.src('src/style.scss')
.pipe(sass({ style: 'expanded'}))
.pipe(autoprefixer('last 2 version', 'ie 9'))
.pipe(gulp.dest('./'));
});
gulp.task('images', function () {
return gulp.src('src/img/**/*')
.pipe(cache(imagemin([
pngquant(),
]))).pipe(gulp.dest('./img'));
});
gulp.task('scripts', function () {
return gulp.src('src/index.js')
.pipe(gulp.dest('./'));
});
gulp.task('html', function () {
return gulp.src('src/index.html')
.pipe(gulp.dest('./'));
});
gulp.task('clean', function () {
del(['img/', 'index.js', 'index.html', 'style.css'])
});
gulp.task('default', ['clean'], function () {
gulp.start('styles', 'images', 'scripts', 'html')
});
gulp.task('watch', function () {
//gulp.watch('src/style.scss', ['styles']);
gulp.watch('src/index.js', ['scripts']);
gulp.watch('src/index.html', ['html']);
gulp.watch('src/img/**/*', ['images']);
gulp.watch(['index.html', 'index.js', 'style.css', 'img/**'])
.on('change', connect.reload);
connect.server({
livereload: true
});
});