Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

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

Awesome Lists containing this project

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.