Skip to content

Commit

Permalink
fix entry queen v2
Browse files Browse the repository at this point in the history
  • Loading branch information
ddecrulle committed May 12, 2023
1 parent 1f7c4a6 commit 4c965fd
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "drama-queen-container",
"private": true,
"version": "1.0.3",
"version": "1.0.4",
"workspaces": [
"drama-queen",
"queen-v2",
Expand Down
8 changes: 5 additions & 3 deletions queen-v2/public/entry.js
Original file line number Diff line number Diff line change
@@ -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`);
Expand All @@ -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();

0 comments on commit 4c965fd

Please sign in to comment.