-
-
Save kolyasademetrio/cbe5d8b3ef3af601c987921d6982ae19 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 group-array@0.3.1 | |
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