-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgulpfile.js
37 lines (29 loc) · 854 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
var gulp = require('gulp');
var usemin = require('gulp-usemin');
var minifyHtml = require('gulp-minify-html');
var minifyCss = require('gulp-minify-css');
var uglify = require('gulp-uglify');
var clean = require('gulp-clean');
gulp.task('usemin',['clean'], function () {
return gulp.src('app/*.html')
.pipe(usemin({
css: ['concat'],
html: [],
js: []
}))
.pipe(gulp.dest('dist/'));
});
gulp.task('compress-scripts',['usemin'], function() {
return gulp.src('dist/scripts/*.js')
.pipe(uglify())
.pipe(gulp.dest('dist/scripts'));
});
gulp.task('copy-assets',['clean'],function(){
return gulp.src('app/assets/**/*')
.pipe(gulp.dest('dist/assets/'));
});
gulp.task('clean', function () {
return gulp.src('dist/**/*', {read: false})
.pipe(clean());
});
gulp.task('default',['usemin','copy-assets']);