forked from udacity/mws-restaurant-stage-1
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgulpfile.js
44 lines (36 loc) · 1016 Bytes
/
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
var gulp = require('gulp'),
connect = require('gulp-connect'),
watch = require('gulp-watch'),
src = ['css/*.css', 'js/*.js' , './*.html'],
webp = require('gulp-webp');
const minify = require('gulp-minify');
let cleanCSS = require('gulp-clean-css');
gulp.task('webserver', function () {
connect.server({
livereload: true,
root: ['./'],
port:8000
});
});
gulp.task('minify-css', () => {
return gulp.src('styles/*.css')
.pipe(cleanCSS({compatibility: 'ie8'}))
.pipe(gulp.dest('dist'));
});
gulp.task('compress', function() {
gulp.src(['js/*.js'])
.pipe(minify())
.pipe(gulp.dest('dist'))
});
gulp.task('livereload', function () {
gulp.src(src)
.pipe(watch(src))
.pipe(connect.reload());
});
gulp.task('watch', function () {
gulp.watch('js/*.js');
gulp.watch('./*.js');
gulp.watch('styles/*.css');
});
//gulp.task('default', ['minify-css','compress','webserver', 'livereload', 'watch']);
gulp.task('default', ['webserver', 'livereload', 'watch']);