-
Notifications
You must be signed in to change notification settings - Fork 0
/
Gulpfile.js
34 lines (34 loc) · 1.12 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
/*global require, console*/
var gulp = require('gulp')
, webserver = require('gulp-webserver')
, jsLint = require("gulp-jslint")
, jsHint = require("gulp-jshint")
, gjsLint = require("gulp-gjslint");
// Servidor web de desarrollo
gulp.task("dev-server", function () {
"use strict";
gulp.src("./app").pipe(webserver({
open: true
, livereload: true
}));
});
// Busca errores de JavaScript de acuerdo con JsLint
gulp.task("jsLint", function () {
"use strict";
return gulp.src(["./app/js/**/*.js"]).pipe(jsLint()).on("error", function (error) {
console.error(String(error));
});
});
// Busca errores de JavaScript de acuerdo con JsHint
gulp.task("jsHint", function () {
"use strict";
return gulp.src(["./app/js/**/*.js"]).pipe(jsHint(".jshintrc")).pipe(jsHint.reporter("default"));
});
// Busca errores de JavaScript de acuerdo con Google JsLinter
gulp.task("jsGoogleLint", function () {
"use strict";
return gulp.src(["./app/js/**/*.js"]).pipe(gjsLint()).pipe(gjsLint.reporter("console"), {
fail: true
});
});
gulp.task("default", ["jsLint", "dev-server"]);