bs-conf

0.1.4 • Public • Published

bs-conf

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.

Install

npm install bs-conf

Usage

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: [
    'index.html',
    'bndl/*'
  ],
  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.

Package Sidebar

Install

npm i bs-conf

Weekly Downloads

1

Version

0.1.4

License

MIT

Last publish

Collaborators

  • pguth