forked from aimacode/aima-javascript
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathGulpfile.babel.js
More file actions
39 lines (31 loc) · 836 Bytes
/
Copy pathGulpfile.babel.js
File metadata and controls
39 lines (31 loc) · 836 Bytes
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
import gulp from 'gulp';
import ghPages from 'gulp-gh-pages';
import jspm from 'jspm';
//var watch = require('gulp-watch');
const dist = 'build';
gulp.task('bundle', (done) => {
jspm.setPackagePath('.');
jspm.bundleSFX('src/index', dist + '/main.js', {
sourceMaps: false,
minify: true,
mangle: true,
separateCSS: true,
})
.then(() => {
done();
})
.catch( (e) => console.log(e));
});
gulp.task('deploy', () => {
return gulp.src(dist + '/**/*')
.pipe(ghPages());
});
gulp.task('copy', function() {
return gulp.src(['index.html','header.html','*-*/*.html','*-*/*.js'])
.pipe(gulp.dest('build'));
});
gulp.task('copyback', function() {
return gulp.src(['./build/*-*/*.html','./build/*-*/*.js'])
.pipe(gulp.dest('./'));
});
gulp.task('default', ['copy','deploy']);