@loaders.gl/polyfills 4.0.0-beta.4 → 4.0.0-beta.6

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@loaders.gl/polyfills",
3
- "version": "4.0.0-beta.4",
3
+ "version": "4.0.0-beta.6",
4
4
  "description": "Polyfills for TextEncoder/TextDecoder",
5
5
  "license": "MIT",
6
6
  "type": "module",
@@ -34,19 +34,20 @@
34
34
  "README.md"
35
35
  ],
36
36
  "browser": {
37
+ "fs": false,
38
+ "path": false,
37
39
  "./src/index.ts": "./src/index.browser.ts",
38
- "./dist/index.js": "./dist/index.browser.js",
39
- "./dist/es5/index.js": "./dist/es5/index.browser.js",
40
- "./dist/esm/index.js": "./dist/es5/index.browser.js"
40
+ "./dist/index.js": "./dist/index.browser.js"
41
41
  },
42
42
  "scripts": {
43
- "pre-build": "npm run build-bundle && npm run build-bundle -- --env=dev",
44
- "build-bundle": "ocular-bundle ./src/index.ts"
43
+ "pre-build": "npm run build-bundle && npm run build-bundle -- --env=dev && npm run build-node-bundle",
44
+ "build-bundle": "ocular-bundle ./src/index.ts",
45
+ "build-node-bundle": "esbuild src/index.ts --outfile=dist/index.cjs --bundle --platform=node --target=node16 --define:__VERSION__=\\\"$npm_package_version\\\""
45
46
  },
46
47
  "dependencies": {
47
48
  "@babel/runtime": "^7.3.1",
48
- "@loaders.gl/crypto": "4.0.0-beta.4",
49
- "@loaders.gl/loader-utils": "4.0.0-beta.4",
49
+ "@loaders.gl/crypto": "4.0.0-beta.6",
50
+ "@loaders.gl/loader-utils": "4.0.0-beta.6",
50
51
  "buffer": "^6.0.3",
51
52
  "get-pixels": "^3.3.2",
52
53
  "ndarray": "^1.0.18",
@@ -55,5 +56,5 @@
55
56
  "through": "^2.3.8",
56
57
  "web-streams-polyfill": "^3.0.0"
57
58
  },
58
- "gitHead": "848c20b474532d301f2c3f8d4e1fb9bf262b86d4"
59
+ "gitHead": "2840f605b7a551e2ffef5f960231d989a0414c50"
59
60
  }
@@ -8,3 +8,9 @@ export const NodeFileSystem = null;
8
8
  export function fetchNode(path: string, options: RequestInit): Promise<Response> {
9
9
  throw new Error('fetchNode not available in browser');
10
10
  }
11
+
12
+ // Ensure process and process.env are defined, as Node code tends to crash on these
13
+ // @ts-ignore
14
+ globalThis.process = globalThis.process || {};
15
+ // @ts-ignore
16
+ globalThis.process.env = globalThis.process.env || {};