bs-rewrite-rules

2.1.2 • Public • Published

bs-rewrite-rules

UI interface for adding/removing/editing Browsersync's rewrite rules

Install

npm i browser-sync bs-rewrite-rules

Usage

var bs = require('browser-sync').create();
 
bs.init({
    proxy: 'http://www.bbc.co.uk',
    plugins: ['bs-rewrite-rules']
});

Now access the Plugins section of the UI (address given in the console) & you'll be presented with:

ui

Works well with serveStatic

Image you have the frontend assets of a live site on your local machine. You could use Browsersync to proxy the live site & then rewrite the links to point to your local files:

var bs = require('browser-sync').create();
 
bs.init({
    proxy: 'http://www.bbc.co.uk',
    plugins: ['bs-rewrite-rules'],
    serveStatic: ['assets'],
    rewriteRules: [
        {
            match: 'http://example.com/skin/frontend/sunspel/default/assets/css/core.min.css',
            replace: '/css/core.css'
        }
    ]
});

Versions

Current Tags

  • Version
    Downloads (Last 7 Days)
    • Tag
  • 2.1.2
    190
    • latest
  • 2.1.1
    0
    • next

Version History

  • Version
    Downloads (Last 7 Days)
    • Published
  • 2.1.2
    190
  • 2.1.1
    0
  • 2.1.0
    1
  • 2.0.0
    0
  • 1.0.0
    4

Package Sidebar

Install

npm i bs-rewrite-rules

Weekly Downloads

164

Version

2.1.2

License

MIT

Last publish

Collaborators

  • shakyshane