-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgulpfile.js
45 lines (37 loc) · 1.26 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
41
42
43
44
45
var gulp = require('gulp'),
babel = require('gulp-babel'),
eslint = require('gulp-eslint'),
sass = require('gulp-sass');
gulp.task('lint', () => {
return gulp.src(["app/js/*.js", "app/js/*.jsx"])
.pipe(eslint())
.on('error', function (error) { console.log(error.toString()); this.emit('end'); })
.pipe(eslint.format());
});
gulp.task('copy', () => {
return gulp.src("app/index.html")
.pipe(gulp.dest("dist"));
});
gulp.task('css', () => {
return gulp.src("app/css/*.css")
.pipe(gulp.dest("dist/css"));
});
gulp.task('sass', () => {
return gulp.src("app/sass/*.scss")
.pipe(sass())
.on('error', function (error) { console.log(error.toString()); this.emit('end'); })
.pipe(gulp.dest("dist/css"));
});
gulp.task('watch', () => {
gulp.watch("app/js/*.js", ['lint', 'js']);
gulp.watch("app/sass/*.scss", ['sass']);
gulp.watch("app/index.html", ['copy']);
gulp.watch("app/js/*.jsx", ['lint', 'jsx']);
});
gulp.task('js', () => {
return gulp.src(["app/js/*.js", "app/js/*.jsx"])
.pipe(babel())
.on('error', function (error) { console.log(error.toString()); this.emit('end'); })
.pipe(gulp.dest("dist"));
});
gulp.task('default', ['lint', 'sass', 'js', 'copy', 'watch']);