@hpcc-js/esbuild-plugins 1.0.6 → 1.0.8

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.md CHANGED
@@ -1,45 +1,45 @@
1
- # esbuild-plugin-sfx-wasm
2
-
3
- ## Installation
4
-
5
- With npm:
6
-
7
- ```sh
8
- npm i -D esbuild-plugin-sfx-wasm
9
- ```
10
-
11
- ## Use-cases
12
-
13
- **The primary motivation for this plugin is to simplify the bundling and distribution of web assembly modules**
14
-
15
- - Compresses the wasm module using Zstd
16
- - Encodes the compressed wasm module as a base91 string
17
- - Generates a standalone module that decodes and instantiates the wasm module on demand
18
-
19
- ## Usage
20
-
21
- ### Build Config
22
-
23
- ```ts
24
- import esbuild from "esbuild";
25
- import sfxWasm from "esbuild-plugin-sfx-wasm";
26
-
27
- esbuild.build({
28
- /* ... */
29
- plugins: [
30
- sfxWasm()
31
- ],
32
- /* ... */
33
- });
34
- ```
35
-
36
- ### Usage in your code
37
-
38
- ```js
39
- import loadCalculator from "../build/calculator.wasm";
40
-
41
- async function add(a, b) {
42
- const calc = await loadCalculator();
43
- return calc.add(1, 2);
44
- }
45
- ```
1
+ # esbuild-plugin-sfx-wasm
2
+
3
+ ## Installation
4
+
5
+ With npm:
6
+
7
+ ```sh
8
+ npm i -D esbuild-plugin-sfx-wasm
9
+ ```
10
+
11
+ ## Use-cases
12
+
13
+ **The primary motivation for this plugin is to simplify the bundling and distribution of web assembly modules**
14
+
15
+ - Compresses the wasm module using Zstd
16
+ - Encodes the compressed wasm module as a base91 string
17
+ - Generates a standalone module that decodes and instantiates the wasm module on demand
18
+
19
+ ## Usage
20
+
21
+ ### Build Config
22
+
23
+ ```ts
24
+ import esbuild from "esbuild";
25
+ import sfxWasm from "esbuild-plugin-sfx-wasm";
26
+
27
+ esbuild.build({
28
+ /* ... */
29
+ plugins: [
30
+ sfxWasm()
31
+ ],
32
+ /* ... */
33
+ });
34
+ ```
35
+
36
+ ### Usage in your code
37
+
38
+ ```js
39
+ import loadCalculator from "../build/calculator.wasm";
40
+
41
+ async function add(a, b) {
42
+ const calc = await loadCalculator();
43
+ return calc.add(1, 2);
44
+ }
45
+ ```