MCPcopy Create free account
hub / github.com/6pac/SlickGrid / startBrowserSync

Function startBrowserSync

scripts/dev-watch.mjs:75–94  ·  view source on GitHub ↗

* Initialize and start BrowserSync * see https://browsersync.io/docs/api#api-watch

()

Source from the content-addressed store, hash-verified

73 * see https://browsersync.io/docs/api#api-watch
74 */
75 async function startBrowserSync() {
76 bsync = browserSync.create();
77
78 bsync.init({
79 server: './',
80 port: 8080,
81 watchTask: true,
82 online: false,
83 open: argv.open,
84 startPath: 'examples/index.html',
85 snippetOptions: {
86 rule: {
87 match: /<\/head>/i,
88 fn: (snippet, match) => snippet.replace('id=', `nonce="browser-sync" id=`) + match
89 }
90 },
91 }, () => {
92 console.log('Use Ctrl+C to Quit');
93 });
94 }
95
96 /** Log to the terminal any watch errors */
97 function onError(err) {

Callers 1

initFunction · 0.85

Calls 1

initMethod · 0.45

Tested by

no test coverage detected