2014-11-23 17:00:07 +00:00
|
|
|
var gulp = require('gulp'),
|
2014-11-23 17:24:03 +00:00
|
|
|
wrap = require('gulp-wrap'),
|
|
|
|
connect = require('gulp-connect'),
|
|
|
|
watch = require('gulp-watch');
|
2014-11-23 16:52:45 +00:00
|
|
|
|
2014-11-23 17:31:52 +00:00
|
|
|
gulp.task('default', ['server'], function() {
|
|
|
|
gulp.watch('./src/**/*.html', ['markup']);
|
2014-11-23 16:52:45 +00:00
|
|
|
});
|
2014-11-23 17:00:07 +00:00
|
|
|
|
2014-11-23 17:31:52 +00:00
|
|
|
gulp.task('server', ['markup'], function() {
|
2014-11-23 17:24:03 +00:00
|
|
|
watch('./build/**/*', { name: 'Server' })
|
|
|
|
.pipe(connect.reload());
|
|
|
|
return connect.server({
|
|
|
|
root: './build',
|
|
|
|
livereload: true
|
|
|
|
});
|
|
|
|
});
|
|
|
|
|
2014-11-23 17:00:07 +00:00
|
|
|
gulp.task('markup', function() {
|
|
|
|
return gulp.src('./src/**/*.html')
|
|
|
|
.pipe(wrap({ src: './template.html' }))
|
|
|
|
.pipe(gulp.dest('./build'))
|
|
|
|
});
|