Nodemon + gulpfile + browsersync
<p>Even if there is a lot of tutorials in a web I found it difficult to configure Nodemon + gulpfile + browsersync. I modified my views which are written in .pug as well as stylesheets which are written in .scss to find whether Browser-sync refresh a browser. Sadly it didn't.</p>

<p>I tried to succeed by following these links:</p>

<ol>
<li><a href="https://gist.github.com/sogko/b53d33d4f3b40d3b4b2e" rel="nofollow noreferrer">It does not refresh my browser.</a></li>
<li><a href="https://ponyfoo.com/articles/a-browsersync-primer" rel="nofollow noreferrer">Tried two last methods it does not refresh my browser either.</a></li>
<li><a href="https://github.com/BrowserSync/browser-sync/issues/392" rel="nofollow noreferrer">It did not help me much.</a></li>
</ol>

<p>My server is listening at port 5000.</p>

<p><strong>This is how my gulpfile.ts looks like:</strong></p>

<pre><code>import * as gulp from "gulp";
import * as sass from "gulp-sass";
import * as plumber from "gulp-plumber";
import * as prefix from "gulp-autoprefixer";
import * as nodemon from "gulp-nodemon";
import * as browsersync from "browser-sync";

const options = {
    pug: {
        "pretty": true
    },

    styles: {
        style: { outputStyle: "expanded" },
        src: "public/stylesheets/*.scss",
        prefixer: {
            browsers: ["last 10 versions"],
            cascade: false
        },
    }
};

gulp.task("serve", () =&gt; {
    browsersync({
        proxy: "localhost:8000",
        open: false
    });

});

gulp.task("nodemon", () =&gt; {
    nodemon({
        script: "server.ts",
        ext: "ts",
        execMap: {
            "ts": "ts-node"
        }
    }).on("restart", () =&gt; {
        browsersync.reload();
    });
})

gulp.task("styles", () =&gt; {
    let opt = options.styles;
    gulp.src(opt.src).
        pipe(sass(options.styles.style).on("error", sass.logError)).
        pipe(prefix(opt.prefixer)).
        pipe(gulp.dest("public/stylesheets"));
});

gulp.task("watch", () =&gt; {
    gulp.watch("public/stylesheets/*.scss", ["styles"]);
});


gulp.task("default", ["styles", "serve", "nodemon", "watch"]);
</code></pre>

<p><strong>My question is:</strong>
What I have to change in my code to accomplish fully workable nodemon and browsersync?
I did a research and I am sure that nodemon works fine.</p>