Created
January 8, 2018 14:31
-
-
Save LoyEgor/f4efd8ea5174b035cd5fcc3737d0ef2c to your computer and use it in GitHub Desktop.
inject css inline
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
//install | |
//npm i gulp-inject [email protected] | |
var inject = require('gulp-inject'); | |
// inject cssinlining | |
gulp.task('inject:cssinlining', function() { | |
return gulp.src('./app/*.html') | |
.pipe(inject(gulp.src('app/css/header.min.css'), { | |
starttag: '<!-- inject:cssinlining -->', | |
transform: function(filePath, file) { | |
return '<style>' + file.contents.toString('utf8') + '</style>' | |
} | |
})) | |
.pipe(gulp.dest('./dist')); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment