-
Notifications
You must be signed in to change notification settings - Fork 0
/
gulpfile.js
40 lines (36 loc) · 1001 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 githubPages = require('gulp-gh-pages');
var gulp = require('gulp');
var webpackStream = require('webpack-stream');
var SITE_OUTPUT_DIR = '_site/';
gulp.task('build', function() {
return gulp.src('main.js')
.pipe(webpackStream({
module: {
loaders: [
{
exclude: /(node_modules|bower_components)/,
loader: 'babel',
query: {
presets: ['es2015']
},
test: /\.jsx?$/
}
]
},
output: {
filename: '[name].generated.js',
libraryTarget: 'umd'
}
}))
.pipe(gulp.dest(SITE_OUTPUT_DIR));
});
gulp.task('copy-misc', function() {
return gulp.src(['README.md'])
.pipe(gulp.dest(SITE_OUTPUT_DIR));
});
gulp.task('publish', ['build', 'copy-misc'], function() {
return gulp.src(SITE_OUTPUT_DIR + '**/*')
.pipe(githubPages({
remoteUrl: 'https://' + process.env.GH_TOKEN + '@github.com/Daniel15/gh-pages-travis-test.git',
}));
});