-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgulpfile.js
39 lines (31 loc) · 1002 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
const gulp = require('gulp');
const browserify = require('browserify');
const source = require('vinyl-source-stream');
var buffer = require('vinyl-buffer');
const del = require('del');
const concat = require('gulp-concat');
const terser = require('gulp-terser');
const streamify = require('gulp-streamify');
function clean(cb) {
console.log("Cleaning");
del(['app/dist/**/*','app/build/**/*']);
cb();
};
function packagejs(cb) {
console.log("Packaging JS");
let bundle = browserify('src/js/main.js').bundle();
return bundle.pipe(source('main.js'))
//.pipe( streamify(terser({keep_fnames: true})) )
.pipe(gulp.dest('./app/build/'));
};
function copycss(sb) {
return gulp.src('./src/css/*.css')
.pipe(gulp.dest('./app/build/'));
}
function copyhtml(sb) {
return gulp.src('./src/*.html')
.pipe(gulp.dest('./app/build/'));
}
exports.build = gulp.series(clean, packagejs, copycss, copyhtml);
exports.clean = gulp.series(clean);
exports.default = exports.build;