Created
September 8, 2021 11:44
-
-
Save averyfreeman/ae4d1f05a66943b16d2e1fe8c8e807e4 to your computer and use it in GitHub Desktop.
browser-sync bs-config.js that will end the document.write errors in devTools
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
'use strict'; | |
// var fallback = require('connect-history-api-fallback'); | |
// var log = require('connect-logger'); | |
/* | |
| For up-to-date information about the options: | |
| http://www.browsersync.io/docs/options/ | |
*/ | |
module.exports = { | |
port: 8085, | |
injectChanges: true, | |
watchOptions: { | |
ignored: ['node_modules', '.git'], | |
}, | |
snippetOptions: { | |
rule: { | |
match: /<\/head>/u, | |
fn(snippet, match) { | |
const { | |
groups: { src }, | |
} = /src='(?<src>[^']+)'/u.exec(snippet); | |
return `<script src="${src}" async></script>${match}`; | |
}, | |
}, | |
}, | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment