I have tried to inject file to index.html file but the path file is not correct. Could you tell me why it happen ?
Folder structure
gulpfile.js
gulp.task('index', function () {
let target = gulp.src('./src/index.html');
// let sources = gulp.src(['./src/resources/js/*.js'], {read: false})
// .pipe(concat('app.js'))
// .pipe(gulp.dest('./src'))
var vendorStream = gulp.src(['./src/resources/js/*.js'])
.pipe(concat('app.js'))
.pipe(gulp.dest('./dist'));
return target.pipe(inject(vendorStream)).pipe(gulp.dest('./dist'))
})
The index file was generated by gulp


Try changing this line:
to:
See injecting files relative to the target file:
So the
option will make the js file(s) injected be relative to the target html file, which in your case are in the same directory.