From 2c4faf48f98d61c00eaa1496221be897ef26e9d1 Mon Sep 17 00:00:00 2001 From: David Taylor Date: Tue, 1 Aug 2023 18:43:33 +0100 Subject: [PATCH] DEV: Fix ember-cli proxy assets (#22674) We were proxying all `/assets/*` requests through to the origin. In local development that was fine, because Rails was able to serve files from the `dist/` directory. But when proxying to a remote origin, we want the local ember-cli to serve its own JS assets --- app/assets/javascripts/bootstrap-json/index.js | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/app/assets/javascripts/bootstrap-json/index.js b/app/assets/javascripts/bootstrap-json/index.js index fae9051fd1d..3e7408e0193 100644 --- a/app/assets/javascripts/bootstrap-json/index.js +++ b/app/assets/javascripts/bootstrap-json/index.js @@ -516,6 +516,15 @@ to serve API requests. For example: return false; } + // All JS assets are served by Ember CLI, except for + // plugin assets which end in _extra.js + if ( + request.path.startsWith(`${baseURL}assets/`) && + !request.path.endsWith("_extra.js") + ) { + return false; + } + if (request.path.startsWith(`${baseURL}_lr/`)) { return false; }