Skip to content

Commit

Permalink
feat: Add zip task to build zip file
Browse files Browse the repository at this point in the history
  • Loading branch information
Marco Ris committed Feb 27, 2020
1 parent 699e775 commit a9732ca
Show file tree
Hide file tree
Showing 4 changed files with 67 additions and 3 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -102,3 +102,6 @@ dist

# TernJS port file
.tern-port

# Builded zip
*.zip
11 changes: 10 additions & 1 deletion gulpfile.babel.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ import del from 'del';
import webpack from 'webpack-stream';
import named from 'vinyl-named';
import browserSync from 'browser-sync';
import zip from 'gulp-zip';
import info from './package.json';

const PRODUCTION = yargs.argv.prod;
const server = browserSync.create();
Expand Down Expand Up @@ -90,6 +92,13 @@ export const reload = done => {
done();
};

// Generate ZIP
export const compress = () => {
return src('dist/**/*')
.pipe(zip(`${info.name}.zip`))
.pipe(dest('.'));
};

// Watch
export const watchForChanges = () => {
watch('src/scss/**/*.scss', styles);
Expand All @@ -100,5 +109,5 @@ export const watchForChanges = () => {
};

export const dev = series(clean, parallel(styles, images, copy, scripts), serve, watchForChanges);
export const build = series(clean, parallel(styles, images, copy, scripts));
export const build = series(clean, parallel(styles, images, copy, scripts), compress);
export default dev;
55 changes: 53 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@
"gulp-sourcemaps": "^2.6.5",
"gulp-uglify": "^3.0.2",
"gulp-util": "^3.0.8",
"gulp-zip": "^5.0.1",
"lodash.template": "^4.5.0",
"vinyl-ftp": "^0.6.1",
"vinyl-named": "^1.1.0",
Expand Down

0 comments on commit a9732ca

Please sign in to comment.