@dcl-regenesislabs/bevy-explorer-web 0.1.0-18309830955.commit-236d8ba → 0.1.0-18312335384.commit-6a81936

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/.env CHANGED
@@ -1 +1 @@
1
- PUBLIC_URL="https://cdn.decentraland.org/@dcl-regenesislabs/bevy-explorer-web/0.1.0-18309830955.commit-236d8ba"
1
+ PUBLIC_URL="https://cdn.decentraland.org/@dcl-regenesislabs/bevy-explorer-web/0.1.0-18312335384.commit-6a81936"
package/index.html CHANGED
@@ -101,7 +101,8 @@
101
101
  }
102
102
  </style>
103
103
  <link href="https://fonts.googleapis.com/css2?family=Inter:wght@400;600;700&display=swap" rel="stylesheet">
104
- </head>
104
+ <script>window.PUBLIC_URL = "https://cdn.decentraland.org/@dcl-regenesislabs/bevy-explorer-web/0.1.0-18312335384.commit-6a81936";</script>
105
+ </head>
105
106
  <body>
106
107
  <div id="header" class="container">
107
108
  <h1>Bevy Explorer</h1>
@@ -129,6 +130,6 @@
129
130
  </div>
130
131
  <script src="https://cdn.jsdelivr.net/npm/livekit-client/dist/livekit-client.umd.min.js"></script>
131
132
  <script src="https://cdn.jsdelivr.net/npm/hls.js@1"></script>
132
- <script type="module" src="https://cdn.decentraland.org/@dcl-regenesislabs/bevy-explorer-web/0.1.0-18309830955.commit-236d8ba/main.js"></script>
133
+ <script type="module" src="https://cdn.decentraland.org/@dcl-regenesislabs/bevy-explorer-web/0.1.0-18312335384.commit-6a81936/main.js"></script>
133
134
  </body>
134
135
  </html>
package/main.js CHANGED
@@ -53,8 +53,10 @@ function hideHeader() {
53
53
 
54
54
  if ("serviceWorker" in navigator) {
55
55
  window.addEventListener("load", () => {
56
+ const publicUrl = window.PUBLIC_URL || ".";
57
+ const serviceWorkerPath = `${publicUrl}/service_worker.js`
56
58
  navigator.serviceWorker
57
- .register("service_worker.js")
59
+ .register(serviceWorkerPath)
58
60
  .then((registration) => {
59
61
  console.log(
60
62
  "Page: Service Worker registered successfully with scope: ",
@@ -112,7 +114,8 @@ async function initEngine() {
112
114
  }
113
115
  }
114
116
 
115
- const wasmUrl = "./pkg/webgpu_build_bg.wasm";
117
+ const publicUrl = window.PUBLIC_URL || ".";
118
+ const wasmUrl = `${publicUrl}/pkg/webgpu_build_bg.wasm`;
116
119
 
117
120
  try {
118
121
  const compiledModule = await WebAssembly.compileStreaming(fetch(wasmUrl));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dcl-regenesislabs/bevy-explorer-web",
3
- "version": "0.1.0-18309830955.commit-236d8ba",
3
+ "version": "0.1.0-18312335384.commit-6a81936",
4
4
  "scripts": {
5
5
  "postinstall": "node ./scripts/prebuild.js"
6
6
  },
@@ -8,6 +8,6 @@
8
8
  "type": "git",
9
9
  "url": "git+https://github.com/decentraland/bevy-explorer.git"
10
10
  },
11
- "homepage": "https://cdn.decentraland.org/@dcl-regenesislabs/bevy-explorer-web/0.1.0-18309830955.commit-236d8ba",
12
- "commit": "236d8ba1971d3d6f756b681da590504e32d56124"
11
+ "homepage": "https://cdn.decentraland.org/@dcl-regenesislabs/bevy-explorer-web/0.1.0-18312335384.commit-6a81936",
12
+ "commit": "6a81936a73d142947504fa694fb77a73375be2a1"
13
13
  }
Binary file
@@ -34,6 +34,13 @@ if (fs.existsSync(htmlPath)) {
34
34
  const publicUrl = ENV_CONTENT["PUBLIC_URL"];
35
35
  const scriptPath = publicUrl ? `${publicUrl}/main.js` : "main.js";
36
36
 
37
+ // Inject PUBLIC_URL as a global variable
38
+ const publicUrlScript = `<script>window.PUBLIC_URL = ${JSON.stringify(publicUrl)};</script>`;
39
+ htmlContent = htmlContent.replace(
40
+ /<\/head>/,
41
+ ` ${publicUrlScript}\n </head>`
42
+ );
43
+
37
44
  // Replace the main.js script src
38
45
  htmlContent = htmlContent.replace(
39
46
  /<script type="module" src="main\.js"><\/script>/,