I have this structure
├── a
│ ├── a.html
│ └── a1.js
│ └── a2.js
├── b
│ ├── b.html
│ └── b1.js
│ └── b2.js
I want to inject the a1.js & a2.js files to a.html. Same case with b. How can I do that with gulp? I cant find what to write on inject()
gulp.task('injectRelative', function () {
gulp.src('./build/**/index.html')
.pipe(inject(gulp.src('./build/**/*.js', {read: false}), {relative: true}))
.pipe(gulp.dest(localConfig.buildFolder));
});
There may be ways to do this entirely within
gulp-injectbut the following is pretty straightforward: