-
-
Save richinfante/92190aaff63ef62c7f231204beb0a670 to your computer and use it in GitHub Desktop.
old website build
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const gulp = require('gulp') | |
const cleanCSS = require('gulp-clean-css') | |
const htmlmin = require('gulp-htmlmin') | |
const minifyInline = require('gulp-minify-inline') | |
const inline_source = require('gulp-inline-source') | |
const path = require('path') | |
gulp.task('minify-css', () => { | |
return gulp.src('_site/**/*.css') | |
.pipe(cleanCSS({ | |
compatibility: 'ie8', | |
level: { | |
1: { | |
specialComments: 'none', | |
removeWhitespace: true, | |
removeEmpty: true | |
} | |
} | |
})) | |
.pipe(gulp.dest('_site')) | |
}) | |
gulp.task('minify-html', function () { | |
return gulp.src('_site/**/*.html') | |
.pipe(htmlmin({ | |
collapseWhitespace: true, | |
removeComments: true, | |
minifyJS: true, | |
preserveLineBreaks: true | |
})) | |
.pipe(inline_source({ | |
rootpath: path.join(__dirname, '_site/') | |
})) | |
.pipe(gulp.dest('_site')) | |
}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment