-
-
Save floatdrop/67ef2ea6c5cb291f458a to your computer and use it in GitHub Desktop.
This file contains hidden or 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
'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