Skip to content

Instantly share code, notes, and snippets.

@jzerbe jzerbe/gulpfile.js
Created Mar 22, 2015

What would you like to do?
gulpfile.js used in conjunction with wGulp
// Initialize and use dependencies from "npm install"
var customizedOptions = {
languages: ['javascript', 'typescript'],
path: {
docs: './report/docs/'
taskTree: {
'karma': {
include: ['express_start']
'test': ['preTest', 'karma', 'express_stop']
var gulp = require('gulp'),
wgulp = require('wGulp')(gulp, customizedOptions),
bg = require('gulp-bg'),
concat = require('gulp-concat'),
insert = require('gulp-insert'),
rename = require('gulp-rename'),
shell = require('gulp-shell'),
uglify = require('gulp-uglify'),
pkg = require('./package.json');
// overrides existing 'dist'! bundles/mins all transpiled output in one file
gulp.task('dist', ['clean', 'build'], function() {
return gulp.src(['build/src/SupportedMethods.js',
.pipe(concat( + '.js'))
.pipe(insert.prepend('/** ' + + ': ' + pkg.version + ' **/\n'))
.pipe(rename( + '.min.js'))
.pipe(insert.prepend('function annotationLibVersion(){return "' + pkg.version + '"}'))
// test data server
gulp.task('express_start', ['preTest'], bg('node', './test_backend/server.js'));
gulp.task('express_stop', ['express_start', 'karma'], shell.task(['./test_backend/']));
// wipe all dependencies
gulp.task('nuclear', shell.task(['rm -r jspm_packages', 'rm -r node_modules']));
// pull down all jspm deps and load all typescript defs
gulp.task('setup', shell.task(['./node_modules/jspm/jspm.js dl-loader',
'./node_modules/tsd/build/cli.js reinstall']));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.