I'm having trouble understanding Browsersync serveStatic while pointed to a proxy URL. From my reading it seems that I should be able to inject CSS into the proxied website. In practice though I can't seem to get it to work. I have used rewriteRules to replace an existing CSS file on the proxy URL with my local CSS but I can't seem to just inject pure CSS if it's not replacing a file. To specify, my CSS is simply not being loaded. If I look at the network traffic, I don't see my stylesheet being loaded. Am I misunderstanding serveStatic or is my configuration incorrect? Below is a simplified extract from my Gulp file.
For reference I'm using Browsersync V2.8.3.
gulp.task('build-css', () => {
return gulp.src('src/scss/**/*.scss')
.pipe(gulpif(arg.sourcemap, sourcemaps.init()))
.pipe(sassLint())
.pipe(concat('styles.scss'))
.pipe(sassLint.format())
.pipe(sassLint.failOnError())
.pipe(sass())
.pipe(autoprefixer('last 10 versions'))
.pipe(cssnano())
.pipe(sourcemaps.write())
.pipe(gulp.dest('web/css'))
.pipe(browserSync.stream({ match: '**/*.css' }));
});
gulp.task('serve', () => {
browserSync.init({
proxy: 'www.sampleurl.com',
serveStatic: ['web/css'],
reloadDelay: 50,
reloadDebounce: 250
});
gulp.watch('src/scss/**/*.scss', ['build-css']);
});