Skip to content

Instantly share code, notes, and snippets.

@niorad
Created July 1, 2015 15:07
Show Gist options
  • Save niorad/5823d63b22f157650258 to your computer and use it in GitHub Desktop.
Save niorad/5823d63b22f157650258 to your computer and use it in GitHub Desktop.
Gulp–Recipe for watching and concatenating JS-Files plus server
var gulp = require('gulp');
var concat = require('gulp-concat');
var connect = require('gulp-connect');
gulp.task('js', function() {
gulp.src(['src/**/*.js'])
.pipe(concat('app.js'))
.pipe(gulp.dest('.'))
.pipe(connect.reload())
});
gulp.task('connect', function() {
connect.server();
});
gulp.task('default', ['js', 'connect'], function() {
gulp.watch('src/**/*.js', ['js'])
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment