Skip to content

webdevz/gulp-inject-js

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

gulp-inject-js

Inject js file to html

Install

npm install gulp-inject-js --save-dev

Usage

const gulp = require('gulp');
const injectJS = require('gulp-inject-js');

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

In the html file, specify the relative path to JS

<html>
  ...
  <!-- inject-js scripts/script.js -->
  ...
</html>

About

Inject JS file into HTML file

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published