From d221804fcd2366cda37b54ffb8aa1843b99f7531 Mon Sep 17 00:00:00 2001 From: Piotr Monarski Date: Wed, 13 Nov 2019 17:39:44 +0100 Subject: [PATCH] fix: FRAMEWORK_STATIC_ASSETS_PATH not being used in server path code --- fusion-cli/entries/server-public-path.js | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/fusion-cli/entries/server-public-path.js b/fusion-cli/entries/server-public-path.js index 2005acc270..d3bf90afd8 100644 --- a/fusion-cli/entries/server-public-path.js +++ b/fusion-cli/entries/server-public-path.js @@ -27,7 +27,19 @@ if (typeof cdnUrl === 'string') { assert(new URL(cdnUrl), 'CDN_URL must be valid absolute URL'); } -let assetBasePath = '/_static/'; +let assetsPath = load('FRAMEWORK_STATIC_ASSET_PATH'); +if (typeof assetsPath === 'string') { + assert( + !assetsPath.endsWith('/'), + 'FRAMEWORK_STATIC_ASSET_PATH must not end with /' + ); + assert( + assetsPath.startsWith('/'), + 'FRAMEWORK_STATIC_ASSET_PATH must start with /' + ); +} + +let assetBasePath = assetsPath ? assetsPath + '/' : '/_static/'; if (prefix) { assetBasePath = prefix + assetBasePath;