From 4c965fd71fa2f94fcc994dd6179389e7b39932d4 Mon Sep 17 00:00:00 2001 From: Dylan Decrulle <81740200+ddecrulle@users.noreply.github.com> Date: Fri, 12 May 2023 11:55:00 +0200 Subject: [PATCH] fix entry queen v2 --- package.json | 2 +- queen-v2/public/entry.js | 8 +++++--- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/package.json b/package.json index 21f86d1a..0ea5c1bc 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "drama-queen-container", "private": true, - "version": "1.0.3", + "version": "1.0.4", "workspaces": [ "drama-queen", "queen-v2", diff --git a/queen-v2/public/entry.js b/queen-v2/public/entry.js index bc6ee5b3..bb42a23b 100644 --- a/queen-v2/public/entry.js +++ b/queen-v2/public/entry.js @@ -1,7 +1,9 @@ const loadQueenV2 = async () => { console.log('Loading queen'); try { - const queenUrl = new URL(document.currentScript.src).origin; + const entryUrl = new URL(document.currentScript.src); + const queenUrl = + entryUrl.origin + entryUrl.pathname.substring(0, entryUrl.pathname.lastIndexOf('/')); window.localStorage.setItem('QUEEN_V2_URL', queenUrl); const manifest = await fetch(`${queenUrl}/asset-manifest.json`); @@ -15,10 +17,10 @@ const loadQueenV2 = async () => { document.body.appendChild(script); } }); - console.log('Queen was successfully loaded'); + console.log('Queen V2 was successfully loaded'); } catch (error) { console.error(error); - console.error('Failed to load Queen as Web Component'); + console.error('Failed to load Queen v2 as Web Component'); } }; loadQueenV2();