-
Notifications
You must be signed in to change notification settings - Fork 0
/
gulpfile.js
45 lines (35 loc) · 1017 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
45
const gulp = require('gulp')
const runSequence = require('run-sequence')
const cleanCSS = require('gulp-clean-css')
const htmlmin = require('gulp-minifier')
//production
if(process.env.NODE_ENV=='production'){
gulp.task('copying html',()=>{
return gulp.src(['./src/**/*.html'])
.pipe(htmlmin({minify: true,
minifyHTML: {
collapseWhitespace: true,
conservativeCollapse: true,
removeComments:true,
minifyCSS: true
}}))
.pipe(gulp.dest('./www'))
})
}else{
//html without minfying
gulp.task('copying html',()=>{
return gulp.src(['./src/**/*.html'])
.pipe(gulp.dest('./www'))
})
}
gulp.task('copying node_module dependency',()=>{
return gulp.src(['./node_modules/bootstrap/**/*.*'])
.pipe(gulp.dest('./www/node_modules/bootstrap'))
})
gulp.task('copying res',()=>{
return gulp.src(['./src/res/**/*'])
.pipe(gulp.dest('./www/res'))
})
gulp.task('default',()=>{
runSequence('copying html', 'copying node_module dependency', 'copying res');
})