Installation

_$: npm install browser-sync --global

Run

We want that whenever there is a change in any CSS file, the browsers synchronize the last version. To achieve this, we will order browsersync to look for files in any CSS file from a certain directory.

a) Static site

_$: browser-sync start --server --files "css/*.css"

b) Dynamic site

_$: browser-sync start --proxy "http://127.0.0.1:6545" --files "css/*.css"

When browsersync has started the server, we can go to http://localhost:3000 and see the site.

If we are serving a site in which the name is important, we can tell browsersync the name we want to use:

_$: browser-sync start \
  --proxy "http://www.example.com:6545" \
  --host "www.example.com" \
  --files "test.css"