@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 +45 -45
- package/dist/index.js +7 -206
- package/dist/index.js.map +4 -4
- package/dist/sfx-wrapper.js +5 -5
- package/dist/sfx-wrapper.js.map +4 -4
- package/package.json +62 -63
- package/src/build.ts +143 -140
- package/src/exclude-sourcemap.ts +20 -20
- package/src/index.ts +5 -5
- package/src/problem-matcher.ts +24 -22
- package/src/rebuild-logger.ts +24 -22
- package/src/sfx-wrapper.ts +108 -108
- package/types/build.d.ts +27 -12
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
|
+
```
|