const {series, watch, src, dest, parallel} = require('gulp'); const postcss = require('gulp-postcss') const livereload = require('gulp-livereload'); const zip = require('gulp-zip'); const concat = require('gulp-concat'); const uglify = require('gulp-uglify'); const cleancss = require('gulp-clean-css'); const purgecss = require('@fullhuman/postcss-purgecss')({ // Specify the paths to all of the template files in your project content: [ './**/*.hbs', './assets/**/*.js', './assets/css/styles.css', // This file defines required styles for the Ghost editor // etc. ], // Include any special characters you're using in this regular expression defaultExtractor: content => content.match(/[\w-/:]+(? watch('assets/css/**', css); const jsWatcher = () => watch('assets/js/**.js', js); const hbsWatcher = () => watch(['*.hbs', 'partials/**/*.hbs'], hbs); const watcher = parallel(cssWatcher, hbsWatcher, jsWatcher); const build = parallel(css,js); const dev = series(build, serve, watcher); function zipper(done) { const targetDir = 'dist/'; const themeName = require('./package.json').name; const filename = themeName + '.zip'; return src([ '**', '!node_modules', '!node_modules/**', '!dist', '!dist/**' ]) .pipe(zip(filename)) .pipe(dest(targetDir)); } exports.build = build; exports.zip = series(build, zipper); exports.dev = dev; exports.default = build;