browser-sync-connect

connect to browser sync without copying the script snippets to the html source

Usage no npm install needed!

<script type="module">
  import browserSyncConnect from 'https://cdn.skypack.dev/browser-sync-connect';
</script>

README

browser-sync-connect

easy way to connect to browser sync without copy and paste the socket.io snippet.

just one line to add the browser-sync script snippts dynamicly:

browserSyncConnect();

regularly i use gulp and gulp connect to run a testserver on port 9000 on my machine and do:

if (window.location.port !== '80' && window.location.port !== '') {
        browserSyncConnect();
}

so the live version will not be browser-synced.