-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgulpfile.js
40 lines (33 loc) · 1018 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
var gulp = require('gulp');
var concat = require('gulp-concat');
var minifyCSS = require('gulp-minify-css');
var size = require('gulp-size')
var paths = {
htmlSource: ['./src/index.html', './src/build.html'],
cssSource: './src/css/**/*.css',
extCss: './src/ext/css/**/*.css',
jsSource: './src/js/**/*.js',
htmlBuild: './build',
jsBuild: './build/js',
cssBuild: './build/css'
}
gulp.task('watch-folder', function() {
gulp.watch(paths.htmlSource, ['copy-html']);
});
gulp.task('copy-html', function() {
gulp.src(paths.htmlSource)
.pipe(gulp.dest(paths.htmlBuild));
});
gulp.task('copy-js', function() {
gulp.src(paths.jsSource)
.pipe(gulp.dest(paths.jsBuild));
});
gulp.task('bundle-css', function () {
return gulp.src([paths.extCss, paths.cssSource])
.pipe(concat('bundle.css'))
.pipe(minifyCSS())
.pipe(size())
.pipe(gulp.dest(paths.cssBuild));
});
gulp.task('default', ['copy-html', 'copy-js', 'bundle-css', 'watch-folder'], function() {
})