-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathgulpfile.js
40 lines (35 loc) · 1015 Bytes
/
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
var gulp = require('gulp');
var gulpsync = require('gulp-sync')(gulp);
var gulp_jspm = require('gulp-jspm');
var webserver = require('gulp-webserver');
var rename = require('gulp-rename');
var htmlreplace = require('gulp-html-replace');
var ghPages = require('gulp-gh-pages');
gulp.task('default', function() {
gulp.src('.')
.pipe(webserver({
livereload: true,
open: true
}));
});
gulp.task('build-dist', ['copy-assets'], function(){
return gulp.src('src/main.js')
.pipe( gulp_jspm({selfExecutingBundle: true, minify: true}) )
.pipe( rename({basename: 'devrelometer.bundle'}) )
.pipe(gulp.dest('dist/'));
});
gulp.task('copy-assets', function() {
return gulp.src('index.html')
.pipe( htmlreplace({js: 'devrelometer.bundle.js'}) )
.pipe(gulp.dest('dist/'));
});
gulp.task('gh-pages-push', function() {
return gulp.src('./dist/**/*')
.pipe(ghPages());
});
gulp.task('deploy', gulpsync.sync(
[
'build-dist',
'gh-pages-push'
]
));