Skip to content

Instantly share code, notes, and snippets.

@floatdrop
Forked from avanderhoorn/gulpfile.js
Created June 29, 2014 16:44
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save floatdrop/67ef2ea6c5cb291f458a to your computer and use it in GitHub Desktop.
Save floatdrop/67ef2ea6c5cb291f458a to your computer and use it in GitHub Desktop.
'use strict';
var gulp = require('gulp'),
gutil = require('gulp-util'),
tslint = require('gulp-tslint'),
typescript = require('gulp-tsc'),
watch = require('gulp-watch'),
plumber = require('gulp-plumber'),
//livereloadEmbed = require('gulp-embedlr'),
lazypipe = require('lazypipe'),
config = {
app: {
js: [ './src/*.js' ],
ts: [ './src/*.ts' ],
jsx: [ './src/*.jsx' ]
},
build: {
js: './build/js'
},
lr: {
port: 7000,
embed: false
},
server: {
port: 8080,
dir: './build'
}
},
onError = function(err) {
gutil.beep();
gutil.log(gutil.colors.underline(gutil.colors.red('ERROR:')) +
' ' + gutil.colors.cyan(err.plugin) + ' - ' + err.message);
},
tslintTask = lazypipe()
.pipe(tslint)
.pipe(tslint.report, 'verbose'),
tscompileTask = lazypipe()
.pipe(tslintTask)
.pipe(typescript)
.pipe(gulp.dest, config.build.js);
gulp.task('watch', function() {
watch({ glob: config.app.ts, emitOnGlob: false, passThrough: false, name: 'TypeScript' }, function(files) {
files
.pipe(tscompileTask())
.on('error', onError);
//.pipe(livereload(lrServer));
});
});
gulp.task('default', function() {
//Not setup yet
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment