forked from bebasid/bebasid.github.io
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgulpfile.js
33 lines (27 loc) · 892 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
28
29
30
31
32
33
'use strict';
var gulp = require('gulp');
var log = require('fancy-log');
//var concatCss = require('gulp-concat-css');
//var cleanCSS = require('gulp-clean-css');
var rename = require('gulp-rename');
//var purify = require('gulp-purifycss');
var critical = require('critical').stream;
var deploy = require('gulp-gh-pages');
// Generate & Inline Critical-path CSS
gulp.task('critical', function () {
return gulp.src('./index.html')
.pipe(critical({
inline: true,
base: 'test/',
css: ['index.css']
}))
.on('error', function(err) { log.error(err.message); })
.pipe(rename("index-critical.html"))
.pipe(gulp.dest('.'));
});
// Push build to gh-pages
gulp.task('deploy', function () {
return gulp.src("./dist/**/*")
.pipe(deploy())
});
//gulp.task('publish', gulp.series('combine', 'minify-css', 'critical'));