Hey people, I'm trying to setup browsersync and gulp for a few hours now and I'm stuck in making a route for my bower components folder.
Here's my file tree

And this is my current broswer-sync task.
gulp.task('browser-sync', function() {
browserSync({
server: {
baseDir: ['src', '.tmp'],
routes: {
'bower_components': '../bower_components'
}
},
open: false,
notify: false
});
});
Is there anything wrong with it?
My index.html inside src has an import like this <script src="bower_components/angular/angular.js"></script> and it doesn't work. :(
server: {
baseDir: ['src', '.tmp'],
routes: {
'/bower_components': 'bower_components'
}
}
The key is the url to match, so anything that begins /bower_components
The value is which folder to serve, but it's relative to your gulpfile.js, that's why simply bower_components will work :)
Oh, thanks! It is working now :+1:
Most helpful comment
The key is the url to match, so anything that begins
/bower_componentsThe value is which folder to serve, but it's relative to your
gulpfile.js, that's why simplybower_componentswill work :)