Skip to content

Instantly share code, notes, and snippets.

@richinfante
Created March 5, 2024 03:57
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save richinfante/92190aaff63ef62c7f231204beb0a670 to your computer and use it in GitHub Desktop.
Save richinfante/92190aaff63ef62c7f231204beb0a670 to your computer and use it in GitHub Desktop.
old website build
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