Browsersync in Aurelia CLI for ASP.NET Core

Isn’t Browsersync working out of the box in the your Aurelia CLI project for ASP.NET Core?
Modify the browsersync section in the file aurelia_project/tasks/run.ts like follows:

    browserSync({
      open: false,
      port: 9000,
      logLevel: 'silent',
      proxy: {
        target: 'localhost:5000'
      }
    }, function (err, bs) {
      let urls = bs.options.get('urls').toJS();
      console.log(`Application Available At: ${urls.local}`);
      console.log(`BrowserSync Available At: ${urls.ui}`);
      done();
    });

If you are serving your ASP.NET Core project on any other port than 5000, remember to change the proxy target.

Happy Coding! 🙂

Browsersync and the Aurelia CLI for ASP.NET Core Projects
Tagged on:     

Leave a Reply

Your email address will not be published. Required fields are marked *