-
Notifications
You must be signed in to change notification settings - Fork 0
/
gulpfile.js
42 lines (35 loc) · 911 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
const gulp = require('gulp');
const babel = require('gulp-babel');
const uglify = require('gulp-uglify');
const sass = require('gulp-sass');
const cleanCss = require('gulp-clean-css');
const watch = require('gulp-watch');
const paths = {
js: 'src/**/*.js',
scss: 'src/**/index.scss',
html: 'src/*.html',
build: 'build'
};
gulp.task('script', () => {
return gulp.src(paths.js)
.pipe(babel({ presets: 'es2015' }))
.pipe(uglify())
.pipe(gulp.dest(paths.build));
});
gulp.task('style', () => {
return gulp.src(paths.scss)
.pipe(sass())
.pipe(cleanCss())
.pipe(gulp.dest(paths.build));
});
gulp.task('html', () => {
return gulp.src(paths.html)
.pipe(gulp.dest(paths.build));
});
gulp.task('watch', function() {
gulp.watch(paths.js, ['script']);
gulp.watch(paths.scss, ['style']);
gulp.watch(paths.html, ['html']);
});
gulp.task('default', ['watch'], () => {
});