forked from web3cr/asoblockchain.org
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgulpfile.js
27 lines (23 loc) · 782 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
const gulp = require('gulp')
const gulpLoadPlugins = require('gulp-load-plugins')
const $ = gulpLoadPlugins()
const fs = require('fs')
const imageminOpts = [
$.imagemin.gifsicle({interlaced: true}),
$.imagemin.jpegtran({progressive: true}),
$.imagemin.optipng({optimizationLevel: 5}),
$.imagemin.svgo({plugins: [{removeViewBox: true}]})
]
gulp.task('optimize-images', () => {
return gulp.src('static-src/img/**/*')
.pipe($.cache($.imagemin(imageminOpts)))
.pipe(gulp.dest('static/img'))
})
gulp.task('deploy', () => {
fs.writeFile('./public/CNAME', 'blockchaincr.com', function (err) {
if (err) return console.log(err)
})
return gulp.src('./public/**/*')
.pipe($.ghPages({branch: 'master'}))
})
gulp.task('clear-cache', () => $.cache.clearAll())