Inject js file to html
npm install gulp-inject-js --save-dev
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>