Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/Weeken/farm-plugin-wasm
Add WebAssembly integration to farm
https://github.com/Weeken/farm-plugin-wasm
Last synced: 2 months ago
JSON representation
Add WebAssembly integration to farm
- Host: GitHub
- URL: https://github.com/Weeken/farm-plugin-wasm
- Owner: Weeken
- Created: 2024-09-12T06:43:35.000Z (4 months ago)
- Default Branch: main
- Last Pushed: 2024-09-12T07:17:45.000Z (4 months ago)
- Last Synced: 2024-09-12T16:46:28.945Z (4 months ago)
- Language: Rust
- Size: 619 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
- awesome-farm - `farm-plugin-wasm`
- awesome-farm - `farm-plugin-wasm`
README
## farm-plugin-wasm
Add WebAssembly integration to farm
### Installation
```bash
pnpm add -D farm-plugin-wasm
```### Usage
```ts
import { defineConfig } from "@farmfe/core";
import wasm from 'farm-plugin-wasm';interface Options {
/* Your options here */
/**
* Whether to split the WASM file
*/
isolate?: boolean // default: false
}export default defineConfig({
compilation: {
input: {
index: "./index.html",
},
output: {
filename: 'assets/[ext]/[name].[hash].[ext]',
assetsFilename: 'static/[resourceName].[ext]'
},
persistentCache: false,
progress: false,
},
plugins: [
wasm({
isolate: false
})
]
});
```### Notes
If you set the ```isolate```option to ```true```, the plugin will use ```top level await``` to get the ```wasm``` file.