Skip to content

Instantly share code, notes, and snippets.

@ozyx
Created December 22, 2016 00:37
Show Gist options
  • Save ozyx/85e5eb85cc9a83165fb669e5ef4f3e3a to your computer and use it in GitHub Desktop.
Save ozyx/85e5eb85cc9a83165fb669e5ef4f3e3a to your computer and use it in GitHub Desktop.
Gulpfile to automatically run tslint then build
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