-
Notifications
You must be signed in to change notification settings - Fork 11
/
Copy pathgulpfile.js
34 lines (29 loc) · 831 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
'use strict';
var gulp = require('gulp'),
deploy = require('gulp-gh-pages'),
watch = require('gulp-watch'),
webpack = require('webpack'),
webpackConf = require('./webpack.config.js');
gulp.task("webpack", function(callback) {
webpack(webpackConf, function(err, stats) {
if(err) throw new gutil.PluginError("webpack", err);
callback();
});
});
gulp.task('watch', function(){
gulp.watch('src/**/*', ['webpack']);
gulp.watch('dist/**/*', ['copy']);
});
gulp.task("copy", function(){
gulp.src("dist/**/*")
.pipe(gulp.dest('example/js'))
gulp.src([
"node_modules/three/three.min.js",
"node_modules/jquery/dist/jquery.min.js"
])
.pipe(gulp.dest('example/js/vendor'));
});
gulp.task('deploy', ['webpack'], function () {
return gulp.src('example/**/*')
.pipe(deploy({push: true}));
});