@dcl-regenesislabs/bevy-explorer-web 0.1.0-18309830955.commit-236d8ba → 0.1.0-18314117233.commit-737e99d

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-18314117233.commit-737e99d"
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-18314117233.commit-737e99d";</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-18314117233.commit-737e99d/main.js"></script>
133
134
  </body>
134
135
  </html>
package/main.js CHANGED
@@ -53,8 +53,9 @@ function hideHeader() {
53
53
 
54
54
  if ("serviceWorker" in navigator) {
55
55
  window.addEventListener("load", () => {
56
+ const serviceWorkerPath = new URL('./service_worker.js', import.meta.url);
56
57
  navigator.serviceWorker
57
- .register("service_worker.js")
58
+ .register(serviceWorkerPath)
58
59
  .then((registration) => {
59
60
  console.log(
60
61
  "Page: Service Worker registered successfully with scope: ",
@@ -112,7 +113,8 @@ async function initEngine() {
112
113
  }
113
114
  }
114
115
 
115
- const wasmUrl = "./pkg/webgpu_build_bg.wasm";
116
+ const publicUrl = window.PUBLIC_URL || ".";
117
+ const wasmUrl = `${publicUrl}/pkg/webgpu_build_bg.wasm`;
116
118
 
117
119
  try {
118
120
  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-18314117233.commit-737e99d",
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-18314117233.commit-737e99d",
12
+ "commit": "737e99dc5971ce42c124a618f7be34267601c2b2"
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>/,