Created
December 20, 2019 07:16
-
-
Save tterb/881ad455a2474009d7e256f0b1c31e63 to your computer and use it in GitHub Desktop.
Gulpfile critical
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
// Create and process critical CSS file to be included in head | |
gulp.task('build:styles:critical', function() { | |
return sass(paths.sassFiles + '/critical.scss', { | |
style: 'compressed', | |
trace: true, | |
loadPath: [paths.sassFiles] | |
}).pipe(postcss([ autoprefixer({ browsers: ['last 2 versions'] }), cssnano()])) | |
.pipe(gulp.dest('_includes')) | |
.on('error', gutil.log); | |
}); | |
// Build all styles | |
gulp.task('build:styles', ['build:styles:main', 'build:styles:critical']); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment