forked from redfin/react-server
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgulpfile.babel.js
31 lines (27 loc) · 979 Bytes
/
gulpfile.babel.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
import eslint from "gulp-eslint";
import gulp from "gulp";
import babel from "gulp-babel";
import logging from "react-server-gulp-module-tagger";
gulp.task("default", () => {
return gulp.src("src/**/*.js")
.pipe(logging())
.pipe(babel())
.pipe(gulp.dest("target"));
});
gulp.task("eslint", [], () => {
return gulp.src("src/*.js")
// eslint() attaches the lint output to the eslint property
// of the file object so it can be used by other modules.
.pipe(eslint())
// eslint.format() outputs the lint results to the console.
// Alternatively use eslint.formatEach() (see Docs).
.pipe(eslint.format())
// To have the process exit with an error code (1) on
// lint error, return the stream and pipe to failOnError last.
.pipe(eslint.failAfterError());
});
// there are no tests for this project :(
gulp.task("test", ["eslint"]);
gulp.task("watch", () => {
gulp.watch("src/*.js", ['default']);
});