Created
January 7, 2020 10:25
-
-
Save choyan/ef4a8966d28692ce7456d489e50df7ce to your computer and use it in GitHub Desktop.
Gulp 4 configuration for gulp-inject
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
const gulp = require('gulp'); | |
const inject = require('gulp-inject'); | |
// use to concat css files | |
function injectIntoHTML() { | |
// It's not necessary to read the files (will speed up things), we're only after their paths: | |
let sources = gulp.src(['./src/**/*.js', './src/**/*.css'], {read: false}); | |
return gulp | |
.src('./src/index.html') | |
.pipe(inject(sources)) | |
.pipe(gulp.dest('./dist/')); | |
} | |
const InjectTasks = gulp.series([injectIntoHTML]) | |
exports.inject = InjectTasks |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment