Created
December 22, 2016 00:37
-
-
Save ozyx/85e5eb85cc9a83165fb669e5ef4f3e3a to your computer and use it in GitHub Desktop.
Gulpfile to automatically run tslint then build
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var gulp = require("gulp"); | |
var ts = require("gulp-typescript"); | |
var tsProject = ts.createProject("tsconfig.json"); | |
const gulp_tslint = require('gulp-tslint'); | |
gulp.task('tslint', () => { | |
return gulp.src(['**/*.ts', '!**/*.d.ts', '!node_modules/**']) | |
.pipe(gulp_tslint()) | |
.pipe(gulp_tslint.report()); | |
}); | |
gulp.task("build", ['tslint'], function () { | |
return tsProject.src() | |
.pipe(tsProject()) | |
.js.pipe(gulp.dest("dist")); | |
}); | |
gulp.task("default", ['build']); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment