I am creating Gulp task that will inject js and css using wiredep. below is how it is getting injected.
<!-- inject:js -->
<script src="/src/config/app.js"></script>
<!-- endinject -->
but I need to inject
<!-- inject:js -->
<script src="config/app.js"></script>
<!-- endinject -->
How do I Ignore '/src/'?
This is what I have tried and didn't work.
Gulp task is below
gulp.task('wiredep', ['styles'], function(){
var options = {
bowerJson: require('./bower.json'),
directory: './bower_components/',
ignorePath: './src/'
};
var wiredep = require('wiredep').stream;
return gulp
.src(config.index)
.pipe(wiredep(options))
.pipe($.inject(gulp.src('./src/**/*.js')))
.pipe(gulp.dest(config.dist));
});
Thanks, Kashyap
You don't say what result you're getting so it's difficult to troubleshoot, but all you have to do is match the path exactly (unless you want to use regex), so in your case this should do the trick;