shopify hot reload code example
Example: shopify hot reload
npm install -g browser-sync
theme new --password=[your-password] --store=[your-store.myshopify.com] --name=[theme name]
theme watch
theme watch --allow-live --notify=/tmp/theme.update
browser-sync init
snippetOptions: {
rule: {
match: /<\/body>/i,
fn: function (snippet, match){
return snippet + match;
},
},
},
browser-sync start --proxy "https://<mystore>.myshopify.com/" --files /tmp/theme.update --reload-delay 1000 --config bs-config.js