-
Notifications
You must be signed in to change notification settings - Fork 9
/
gulpfile.js
39 lines (32 loc) · 920 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
var gulp = require('gulp'),
uglify = require('gulp-uglify'),
webserver = require('gulp-webserver'),
watch = require('gulp-watch'),
sass = require('gulp-sass');
gulp.task('uglify', function() {
gulp.src('./src/*.js')
.pipe(uglify())
.pipe(gulp.dest('dist'));
});
gulp.task('sass', function() {
gulp.src('./src/*.scss')
.pipe(sass())
.pipe(gulp.dest('dist'));
});
gulp.task('webserver', function() {
gulp.src('.')
.pipe(webserver({
host: 'localhost',
port: 8000,
livereload: true,
directoryListing: false,
open: false,
fallback: 'example.html'
}));
});
gulp.task('watch', function(){
gulp.watch('./src/*.scss', ['sass']);
gulp.watch('./src/*.js', ['uglify']);
});
gulp.task('build', ['uglify', 'sass']);
gulp.task('default', ['build', 'webserver', 'watch']);