BrowserSync is not working on the root dir

130 Views Asked by At

BrowserSync gulp plugin, Is not reloading the browser page while the view is on the index.html which means localhost:3000

gulp.task("browserSync", function () {
  browserSync.init({
    server: {
      baseDir: "./public"
    }
  });
});

gulp.task("liveReload", [
  "browserSync", "copy", "watch"
], function () {
  gulp.watch("src/**/*.html", browserSync.reload);
});

it's reloading only when the URL is pointing to other .html pages. like: localhost:3000/en/pricing.html

Project Structure:

src

index.html
/html
  pricing.html
  ...

Public

index.html
 /en
  pricing.html
  ...
 /ar
  pricing.html
  ...

What is my code issue?

0

There are 0 best solutions below