This repository has been archived by the owner on Apr 14, 2023. It is now read-only.
starterkit 1.0.3
Gulp
gulp critical
: This task extracts & inlines critical-path (above-the-fold) CSS from HTML using critical.
gulp.task('critical', function () {
return gulp.src(routes.files.htmlFiles)
.pipe(critical({
base: baseDirs.dist,
inline: true,
html: routes.files.htmlFiles,
css: routes.files.styleCss,
ignore: ['@font-face',/url\(/],
width: 1300,
height: 900
}))
.pipe(plumber({
errorHandler: notify.onError({
title: "Error: Critical failed.",
message:"<%= error.message %>"
})
}))
.pipe(gulp.dest(baseDirs.dist))
.pipe(notify({
title: 'Critical Path completed!',
message: 'css critical path done!'
}));
});
Added critical
to optimize
task.
Created a baseDirs
object to define the baseDirs of the project.
var baseDirs = {
dist:'dist/',
src:'src/',
assets: 'dist/assets/'
};
Package
Updated dependencies:
- [email protected] -> 3.1.0
- gulp [email protected] -> 5.3.0