Skip to content

Commit

Permalink
fix: πŸ› include prefix in browser reload when present
Browse files Browse the repository at this point in the history
  • Loading branch information
Nick Reese committed May 11, 2021
1 parent d1d0f09 commit 7df21ab
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion packages/browser-reload/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,12 @@ const plugin = {
plugin.run = !plugin.settings.build && notProd;
plugin.origin = plugin.settings.origin.includes('://') ? plugin.settings.origin : 'http://localhost';

plugin.path = plugin.settings.prefix;

if (plugin.path) {
console.log('> Elder.js Auto Reload Plugin auto reloading path:', plugin.settings.prefix);
}

plugin.serverPort = process.env.SERVER_PORT || 3000;

if (plugin.run) {
Expand Down Expand Up @@ -52,7 +58,7 @@ const plugin = {
async function checkServer(tryCount = 0){
try {
var up = await fetch('${plugin.origin}:${plugin.serverPort}');
var up = await fetch('${plugin.origin}:${plugin.serverPort}${plugin.path}');
if(up.ok) return true;
} catch(e) {
// do nothing
Expand Down

0 comments on commit 7df21ab

Please sign in to comment.