A wrapper of `browser-sync` that reads the configuration from `bs-conf.js`.

Usage no npm install needed!

<script type="module">
  import bsConf from '';



A wrapper of browser-sync that reads the configuration from bs-conf.js. This makes it easier to execute browser-sync from your package.json script section.


npm install bs-conf


Create bs-conf.js at the root of your project. Simply export a configuration object using browser-sync options like so:

// `bs-conf.js` example:
module.exports = {
  server: true,
  open: false,
  reloadOnRestart: true,
  files: [
  injectChanges: true,
  snippetOptions: {
    rule: {
      match: /\n$/i, // match last linebreak
      fn: function (snippet, match) {
        return snippet + match

In your package.json you could now have an entry like

  "scripts": {
    "watch": "npm run bs-conf"

and start it with npm run watch.