@farmfe/plugin-wasm 0.0.6 → 0.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.
Files changed (2) hide show
  1. package/README.md +7 -2
  2. package/package.json +15 -13
package/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # @farmfe/plugin-wasm
2
2
 
3
- A farm plugin for importing Wasm modules.
3
+ A Farm plugin for seamless WebAssembly integration and support `wasm-pack` generated modules.
4
4
 
5
5
  ## Installation
6
6
 
@@ -48,4 +48,9 @@ init({
48
48
  });
49
49
  ```
50
50
 
51
- In production builds, `.wasm` files smaller than the `assetInlineLimit` will be inlined as base64 strings. Otherwise, they will be treated as static assets and fetched on demand.
51
+ You can also directly import WASM packages like ESM modules without using the `?init` query:
52
+
53
+ ```ts
54
+ import { someFunc } from 'wasm-project';
55
+ someFunc(); // Run this wasm function
56
+ ```
package/package.json CHANGED
@@ -1,12 +1,13 @@
1
1
  {
2
2
  "name": "@farmfe/plugin-wasm",
3
- "version": "0.0.6",
3
+ "version": "0.0.8",
4
4
  "main": "scripts/index.js",
5
5
  "types": "scripts/index.d.ts",
6
6
  "type": "module",
7
7
  "license": "MIT",
8
8
  "devDependencies": {
9
- "@farmfe/plugin-tools": "latest"
9
+ "@farmfe/plugin-tools": "latest",
10
+ "@types/node": "^22.13.1"
10
11
  },
11
12
  "napi": {
12
13
  "name": "farmfe_plugin_wasm",
@@ -36,20 +37,21 @@
36
37
  "options.d.ts"
37
38
  ],
38
39
  "optionalDependencies": {
39
- "@farmfe/plugin-wasm-darwin-arm64": "0.0.6",
40
- "@farmfe/plugin-wasm-darwin-x64": "0.0.6",
41
- "@farmfe/plugin-wasm-linux-arm64-gnu": "0.0.6",
42
- "@farmfe/plugin-wasm-linux-arm64-musl": "0.0.6",
43
- "@farmfe/plugin-wasm-linux-x64-gnu": "0.0.6",
44
- "@farmfe/plugin-wasm-linux-x64-musl": "0.0.6",
45
- "@farmfe/plugin-wasm-win32-arm64-msvc": "0.0.6",
46
- "@farmfe/plugin-wasm-win32-ia32-msvc": "0.0.6",
47
- "@farmfe/plugin-wasm-win32-x64-msvc": "0.0.6"
40
+ "@farmfe/plugin-wasm-darwin-arm64": "0.0.8",
41
+ "@farmfe/plugin-wasm-darwin-x64": "0.0.8",
42
+ "@farmfe/plugin-wasm-linux-arm64-gnu": "0.0.8",
43
+ "@farmfe/plugin-wasm-linux-arm64-musl": "0.0.8",
44
+ "@farmfe/plugin-wasm-linux-x64-gnu": "0.0.8",
45
+ "@farmfe/plugin-wasm-linux-x64-musl": "0.0.8",
46
+ "@farmfe/plugin-wasm-win32-arm64-msvc": "0.0.8",
47
+ "@farmfe/plugin-wasm-win32-ia32-msvc": "0.0.8",
48
+ "@farmfe/plugin-wasm-win32-x64-msvc": "0.0.8"
48
49
  },
49
50
  "scripts": {
50
51
  "dev": "cargo watch -w src -s 'scripts/watch.sh'",
51
52
  "bump": "npx changeset version",
52
- "play": "pnpm --filter playground dev",
53
- "build": "farm-plugin-tools build --platform --cargo-name farmfe_plugin_wasm -p farmfe_plugin_wasm --release"
53
+ "play": "pnpm build:wasm && pnpm --filter playground dev",
54
+ "build": "farm-plugin-tools build --platform --cargo-name farmfe_plugin_wasm -p farmfe_plugin_wasm --release",
55
+ "build:wasm": "wasm-pack build rust-wasm --target bundler --out-dir ../playground/wasm"
54
56
  }
55
57
  }