Skip to content
  • Web

WebAssembly Runtime

Resolve the low-level WebAssembly runtime module in a browser build.

Examples

Quick start

For application code, prepareCore initializes the runtime and handles browser asset loading.

nayan-ui/wasm-runtime
export async function loadRuntime() {
  return import('nayan-ui/wasm-runtime');
}

Load the runtime only in a browser

For normal application startup use prepareCore from nayan-ui/core, which also locates and initializes engine assets.

nayan-ui/wasm-runtime
export async function browserRuntime() {
  if (typeof window === 'undefined') return undefined;
  return import('nayan-ui/wasm-runtime');
}
Related guide

Tags