gulp-inject-js
v1.0.3
Published
Inject JS file into HTML file
Downloads
3
Readme
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>