Skip to content

Instantly share code, notes, and snippets.

Created June 17, 2020 23:41
What would you like to do?
var gulp = require('gulp');
var sass = require('gulp-sass');
var livereload = require('gulp-livereload');
var inlineCss = require('gulp-inline-css');
var replace = require('gulp-replace');
var fs = require('fs');
sass.compiler = require('node-sass');
gulp.task('sass', function () {
return gulp.src('./res/sass/*.scss')
.pipe(sass().on('error', sass.logError))
gulp.task('watch', function() {
livereload.listen();'./res/sass/*.scss', gulp.series('build'));'./index.html', gulp.series('build'));
gulp.task('inline', function() {
return gulp.src('./*.html')
applyWidthAttributes: true,
applyTableAttributes: true,
removeHtmlSelectors: true,
removeLinkTags: true
.pipe(replace('%FONT-FACE%', function(s) {
var tmpl = fs.readFileSync('font-face.html', 'utf8');
return tmpl;
gulp.task('default', gulp.series('watch'));
gulp.task('build', gulp.series('sass', 'inline'));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment