@bytescale/sdk 3.0.0-alpha.5 → 3.0.0-alpha.7
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/README.ESM.md +14 -0
- package/package.json +1 -13
- package/dist/node/esm/main.mjs +0 -2671
package/README.ESM.md
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
# Bytescale JavaScript SDK: ESM
|
|
2
|
+
|
|
3
|
+
The Bytescale JavaScript SDK offers 2x different modules:
|
|
4
|
+
|
|
5
|
+
1. Node.js (uses streams, buffers, etc.)
|
|
6
|
+
2. Browser (uses XHR for better progress reporting, blobs, etc).
|
|
7
|
+
|
|
8
|
+
Fortunately, NPM offers a mature solution for providing different implementations for Node.js and browser via `main` and `browser` respectively. These accept CommonJS modules.
|
|
9
|
+
|
|
10
|
+
Unfortunately, the equivalent for ESM modules is using [Conditional Exports](https://nodejs.org/api/packages.html#conditional-exports), but this seems to be supported differently across bundling tools.
|
|
11
|
+
|
|
12
|
+
Specifically, we have found that Webpack (5.24.1) ignores the "browser" guard and trys to load the "default" guard (if it exists) and fails if no default is present.
|
|
13
|
+
|
|
14
|
+
Since we cannot use the "default" guard (because if the wrong module is imported then errors will occur) we cannot offer an ESM option.
|
package/package.json
CHANGED
|
@@ -1,24 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@bytescale/sdk",
|
|
3
|
-
"version": "3.0.0-alpha.
|
|
3
|
+
"version": "3.0.0-alpha.7",
|
|
4
4
|
"description": "Bytescale JavaScript SDK",
|
|
5
5
|
"author": "Bytescale <hello@bytescale.com> (https://www.bytescale.com)",
|
|
6
6
|
"license": "MIT",
|
|
7
7
|
"types": "dist/types/index.d.ts",
|
|
8
8
|
"main": "dist/node/cjs/main.js",
|
|
9
|
-
"module": "dist/node/esm/main.mjs",
|
|
10
9
|
"browser": "dist/browser/cjs/main.js",
|
|
11
|
-
"exports": {
|
|
12
|
-
".": {
|
|
13
|
-
"node": {
|
|
14
|
-
"require": "./dist/node/cjs/main.js",
|
|
15
|
-
"import": "./dist/node/esm/main.mjs"
|
|
16
|
-
},
|
|
17
|
-
"browser": {
|
|
18
|
-
"require": "./dist/browser/cjs/main.js"
|
|
19
|
-
}
|
|
20
|
-
}
|
|
21
|
-
},
|
|
22
10
|
"homepage": "https://www.bytescale.com/docs/sdks/javascript",
|
|
23
11
|
"repository": {
|
|
24
12
|
"type": "git",
|