We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
I can't get rewrite rules such as:
{ match: /some (stuff)/, replace: 'hot $1' }
to replace the $1 like String.prototype.replace does. The resulting string always keeps the $1.
$1
This is surprising, since using $1 is advertised in: https://www.browsersync.io/docs/options/#option-rewriteRules https://github.com/BrowserSync/browser-sync/blob/master/examples/proxy.rewriteRules.advanced.js
bs-config.js:
bs-config.js
module.exports = { proxy: 'example.com', rewriteRules: [ { match: /(<!doctype html>)/i, replace: '<!-- $1 -->' } ] }
Run browser-sync start --config=bs-config.js.
browser-sync start --config=bs-config.js
See the HTML source: doctype is replaced by <!-- $1 -->.
<!-- $1 -->
Tried on two computers:
Only tried with CLI + config file. Might impact other use cases too.
The text was updated successfully, but these errors were encountered:
thanks @fvsch this is indeed a bug.
Sorry, something went wrong.
No branches or pull requests
Issue details
I can't get rewrite rules such as:
to replace the
$1
like String.prototype.replace does. The resulting string always keeps the$1
.This is surprising, since using
$1
is advertised in:https://www.browsersync.io/docs/options/#option-rewriteRules
https://github.com/BrowserSync/browser-sync/blob/master/examples/proxy.rewriteRules.advanced.js
Steps to reproduce/test case
bs-config.js
:Run
browser-sync start --config=bs-config.js
.See the HTML source: doctype is replaced by
<!-- $1 -->
.Please specify which version of Browsersync, node and npm you're running
Tried on two computers:
Browsersync use-case
Only tried with CLI + config file. Might impact other use cases too.
The text was updated successfully, but these errors were encountered: