mind-overflow-website-ghost.../gulpfile.js

36 lines
802 B
JavaScript
Raw Normal View History

2020-11-06 17:49:14 +01:00
const gulp = require('gulp');
const uglify = require('gulp-uglify');
const pump = require('pump');
const zip = require('gulp-zip');
function js(done) {
pump([
gulp.src('assets/js/*.js', {sourcemaps: true}),
uglify(),
gulp.dest('assets/built/', {sourcemaps: '.'})
], done());
}
exports.js = js;
function zipper(done) {
var targetDir = 'dist/';
var themeName = require('./package.json').name;
var filename = themeName + '.zip';
pump([
gulp.src([
'**',
'!node_modules', '!node_modules/**',
'!dist', '!dist/**',
'!*.ignore',
'!gulpfile.js',
'!package-lock.json'
]),
zip(filename),
gulp.dest(targetDir)
], done());
}
exports.zip = zipper;