-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgulpfile.js
32 lines (25 loc) · 870 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
var gulp = require('gulp');
var browserify = require('browserify');
var source = require('vinyl-source-stream');
var babelify = require('babelify');
var del = require('del');
var target = './target/www/';
gulp.task('browserify', function() {
return browserify('./src/js/main.js')
.transform(babelify.configure({nonStandard: true}))
.bundle()
.pipe(source('site.js'))
.pipe(gulp.dest(target + "js/"));
});
gulp.task('copy-resources', function() {
gulp.src('./src/**/*.html').pipe(gulp.dest(target));
gulp.src('./src/images/*.svg').pipe(gulp.dest(target + 'images/'))
});
gulp.task('watch', function() {
gulp.watch(['./src/js/**'], ['browserify']);
gulp.watch(['./src/**/*.html', './src/images/**'], ['copy-resources']);
});
gulp.task('clean', function() {
del([target+'**']);
});
gulp.task('default', ['copy-resources', 'browserify']);