Skip to content

Instantly share code, notes, and snippets.

@choyan

choyan/Gulpfile.js

Created Jan 7, 2020
Embed
What would you like to do?
Gulp 4 configuration for gulp-inject
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