# ondine/compiler/wasm/all

The size-optimized compiler module for every diagram type, inlined as base64.

`ondine/compiler/wasm/all` exports one value, `wasm`, for [`create`](/docs/api/compiler/create). The entrypoint is about 830 kB gzip. The `all.wasm` file is about 630 kB gzip and compiles while it downloads. Thus a page loads it with a dynamic import only when the page needs a compiler.

```ts title="preview.ts"
import { create } from 'ondine/compiler/wasm'

// Downloads the module only when the preview opens
const { wasm } = await import('ondine/compiler/wasm/all')
const renderer = create({ modules: { all: wasm } })
```

## Exports

### wasm

* **Type:** `string`

The bytes of the module as base64. `create` compiles them synchronously at the first render.

```ts
import { create } from 'ondine/compiler/wasm'
import { wasm } from 'ondine/compiler/wasm/all'

// Registers the module under the key `all`
create({ modules: { all: wasm } })
```

Some hosts, such as Cloudflare Workers, do not allow compilation at runtime. These hosts cannot compile these bytes. On such a host, pass a precompiled `WebAssembly.Module` to `create`.
