From 653b39000598581aa677e439e5940c6fcd139d00 Mon Sep 17 00:00:00 2001 From: Michael Klein Date: Mon, 24 Oct 2022 14:28:58 +0200 Subject: [PATCH] fix: customize eai publicAssetURL in production The `lib/startup`-addon is used to create a custom index.html page to boot up the app. Because this is a custom approach and we aren't relying on setting rootURL to a different value when running the app in `production` we need to set `publicAssetURL` in the configuration we pass to `ember-auto-import`. Reference: https://github.com/ef4/ember-auto-import/blob/9a2887f1d09c1df2a41d7e6800820ba23183365e/docs/upgrade-guide-2.0.md#quick-summary --- ui/packages/consul-ui/ember-cli-build.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/ui/packages/consul-ui/ember-cli-build.js b/ui/packages/consul-ui/ember-cli-build.js index aa5d243074..6a1f6bc952 100644 --- a/ui/packages/consul-ui/ember-cli-build.js +++ b/ui/packages/consul-ui/ember-cli-build.js @@ -17,6 +17,7 @@ module.exports = function (defaults, $ = process.env) { $ = utils.env($); const env = EmberApp.env(); + const isProd = ['production'].includes(env); const prodlike = ['production', 'staging']; const devlike = ['development', 'staging']; const sourcemaps = !['production'].includes(env) && !$('BABEL_DISABLE_SOURCEMAPS', false); @@ -197,6 +198,7 @@ module.exports = function (defaults, $ = process.env) { autoImport: { // allows use of a CSP without 'unsafe-eval' directive forbidEval: true, + publicAssetURL: isProd ? '{{.ContentPath}}assets' : undefined, }, codemirror: { keyMaps: ['sublime'],