From 8d53f8ef1a27bd93cbd01aa83f3ad22c1d91cc0d Mon Sep 17 00:00:00 2001 From: David Taylor Date: Wed, 13 Nov 2024 16:39:23 +0000 Subject: [PATCH] DEV: Simplify livereload configuration for better proxy compatibility (#29742) When running a development environment behind a proxy (e.g. when using a cloud development environment, or a service like ngrok), the ember-cli port & protocol may not match the one in the browser. `livereload.js` knows how to auto-configure itself based on the current browser environment... but Ember CLI overrides that autoconfiguration with some hard-coded values. The intention there is to allow running the livereload server on a different port to the ember-cli web proxy. We don't need that functionality. This commit stops loading `ember-cli-live-reload.js`, and instead loads `_lr/livereload.js` directly. --- app/assets/javascripts/custom-proxy/index.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/app/assets/javascripts/custom-proxy/index.js b/app/assets/javascripts/custom-proxy/index.js index cd53472441d..6a62acf8aa7 100644 --- a/app/assets/javascripts/custom-proxy/index.js +++ b/app/assets/javascripts/custom-proxy/index.js @@ -95,8 +95,10 @@ function updateScriptReferences({ ); } + // We use _lr/livereload.js directly instead of ember-cli-live-reload so that the protocol/port is configured automatically + // (important for cloud development environments like GitHub CodeSpaces) newElements.unshift( - `` + `` ); }