Antonio Pavicevac-Ortiz
Antonio Pavicevac-Ortiz

Reputation: 7739

Getting gulp-file-include and browser-sync to work together

I read in a blog you could use gulp-file-include to include .html files, It works but the code below winds up overwriting the include markup in the html...

You might think why don't I have gulp-file-include spit out to another destination folder? Reason being is then I can't get browser-sync to refresh the browser after that. Essentially this link is illustrating my problem...

Looks like there is supposed to be another 'output' folder which will be distilling all the includes into a new .index.html file

I know I could just open up the file which is receiving the includes and then browserSync would work, but isn't that an extra step?

Please ask questions as this seems very inceptionesque!

gulp.task('fileinclude', function() {
  gulp.src('builds/development/*.html')
  .pipe(fileinclude())
  .pipe(gulp.dest('builds/development/'));
});

Upvotes: 3

Views: 3018

Answers (1)

Antonio Pavicevac-Ortiz
Antonio Pavicevac-Ortiz

Reputation: 7739

Turns out I hadn't included the fileinclude in my watch task...

For anyone who wants to check out what I ended up with check out my gist...

https://gist.github.com/antonioOrtiz/2bf2e27b8e0a23115034

Upvotes: 2

Related Questions