-
Notifications
You must be signed in to change notification settings - Fork 0
/
gulpfile.js
48 lines (41 loc) · 1.32 KB
/
gulpfile.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
var gulp = require('gulp');
var gutil = require('gulp-util');
var browserSync = require('browser-sync');
var cp = require('child_process');
var fs = require('fs');
var messages = {
reload: 'Reloading...',
build: 'Building Middleman...'
};
gulp.task('middleman-build', function(done) {
browserSync.notify(messages.build);
cp.spawn('bundle', ['exec', 'middleman', 'build'], { stdio: 'inherit' }).on('close', done);
});
gulp.task('browser-reload', ['middleman-build'], function() {
browserSync.notify(messages.reload);
browserSync.reload();
});
gulp.task('browser-sync', ['middleman-build'], function() {
browserSync({
server: {
baseDir: 'build'
},
port: 4060
});
});
gulp.task('watch', function() {
gulp.watch('source/**/*.*', ['browser-reload']);
});
gulp.task('middleman', function(done) {
cp.spawn('bundle', ['exec', 'middleman'], { stdio: 'inherit' }).on('close', done);
});
gulp.task('serve', ['browser-sync', 'watch']);
gulp.task('build', ['middleman-build']);
gulp.task('deploy', ['rsync']);
gulp.task('install-bower', function(done) {
cp.spawn('bower', ['install'], { stdio: 'inherit' }).on('close', done);
});
gulp.task('install-bundle', function(done) {
cp.spawn('bundle', ['install'], { stdio: 'inherit' }).on('close', done);
});
gulp.task('install', ['install-bundle', 'install-bower']);