-
Notifications
You must be signed in to change notification settings - Fork 1
/
gulpfile.js
40 lines (35 loc) · 1.02 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
var gulp = require('gulp');
var uglify = require('gulp-uglify');
var minifyCss = require('gulp-minify-css');
var concat = require('gulp-concat');
var clean = require('gulp-clean');
var rename = require('gulp-rename');
var webserver = require('gulp-webserver');
var livereload = require('gulp-livereload');
gulp.task('start', function() {
return gulp.src('.')
.pipe(webserver({
livereload: false,
directoryListing: false,
open: true
}));
});
gulp.task('clean', function() {
gulp.src('dist/*').pipe(clean());
});
gulp.task('compress', function() {
return gulp.src(['app/**/*.js', 'app/*.js'])
.pipe(concat('all.js'))
.pipe(gulp.dest('dist'))
.pipe(rename('all.min.js'))
.pipe(uglify())
.pipe(gulp.dest('dist'));
});
gulp.task('minify-css', function() {
return gulp.src(['css/*.css', '*.css'])
.pipe(minifyCss({
compatibility: 'ie8'
}))
.pipe(gulp.dest('dist'));
});
gulp.task('build', ['start']);