Skip to content
master
Switch branches/tags
Code

Latest commit

 

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
 
 
 
 
 
 
 
 
 
 
 
 
 
 

gulp-inject-css

GitHub Actions Dependency Status devDependency Status

Inject css file to html

Install

npm install gulp-inject-css --save-dev

Usage

const gulp = require('gulp');
const injectCSS = require('gulp-inject-css');

gulp.task('inject-css', function() {
  gulp.src('src/*.html')
    .pipe(injectCSS())
    .pipe(gulp.dest('dist'));
});

In the html file, specify the relative path to css

<html>
  ...
  <!-- inject-css css/main.css -->
  ...
</html>