@remix_labs/hub-client 2.1853.0-dev → 2.1869.0-dev

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.
Files changed (2) hide show
  1. package/index.js +8 -4
  2. package/package.json +1 -1
package/index.js CHANGED
@@ -3,14 +3,18 @@ function workerify(code) {
3
3
  return new globalThis.Worker(URL.createObjectURL(blob));
4
4
  }
5
5
 
6
- import HubWorker from './hub-worker.worker.js?raw';
7
- //import HubWorker from './hub-worker.worker.js?worker&inline';
6
+ import HubWorker from './hub-worker.worker.js?worker&inline';
8
7
 
9
8
  function GetHubWorker() {
10
- //return HubWorker;
11
- return workerify(HubWorker);
9
+ // vite makes this into a constructor, but in webpack we get the raw buffer
10
+ if ((typeof HubWorker) === "function") {
11
+ return new HubWorker();
12
+ } else {
13
+ return workerify(HubWorker);
14
+ }
12
15
  }
13
16
 
17
+ globalThis.HubWorkerImport = HubWorker;
14
18
  globalThis.GetHubWorker = GetHubWorker;
15
19
 
16
20
  export * from './common.js';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@remix_labs/hub-client",
3
- "version": "2.1853.0-dev",
3
+ "version": "2.1869.0-dev",
4
4
  "description": "talk to the Hub web worker",
5
5
  "main": "node.js",
6
6
  "browser": "index.js",