-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathbundle.js
More file actions
28 lines (24 loc) · 703 Bytes
/
bundle.js
File metadata and controls
28 lines (24 loc) · 703 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
import gulp from 'gulp'
import { paths } from '../gulpfile'
import del from 'del'
import zip from 'gulp-zip'
import fancyLog from 'fancy-log'
import chalk from 'chalk'
import pkg from '../package.json'
function zipFiles() {
return gulp.src('build/**/*')
.pipe(zip(`${pkg.name}.zip`))
.pipe(gulp.dest('build'))
}
function cleanZippedFiles() {
return del(['build/*', '!build/*.zip'])
}
async function logBundle() {
fancyLog()
fancyLog(chalk.green(`Bundle successful!`))
fancyLog(chalk.cyan(`The zip is ready to be published`))
fancyLog()
fancyLog(` ${chalk.gray(`build/`)}${pkg.name}.zip`)
fancyLog()
}
export const bundle = gulp.series(zipFiles, cleanZippedFiles, logBundle)