Appearance
@bendyline/molen-client/vite
Molen rendering client: three.js wrapper, snapshot sync, interpolation.
ts
import { /* … */ } from '@bendyline/molen-client/vite';Interfaces
MolenScriptsOptions
Properties
include?
ts
optional include?: RegExp;Restrict stripping to matching paths (default: any .ts imported with ?raw).
MolenScriptsPlugin
The subset of Vite's plugin shape this uses; structural, so no dependency on vite.
Properties
enforce
ts
enforce: "pre";name
ts
name: string;Methods
load()
ts
load(id): Promise<string | undefined>;Parameters
id
string
Returns
Promise<string | undefined>
Functions
molenScripts()
ts
function molenScripts(options?): MolenScriptsPlugin;Vite plugin: serve *.ts?raw imports as type-stripped JavaScript, so a browser host can glob its scene scripts (import.meta.glob('../scripts/*.ts', { query: '?raw' })) and hand the strings to inlineScriptSources exactly as it did with .js.
Parameters
options?
Returns
stripScriptTypes()
ts
function stripScriptTypes(source, filename): string;Erase the types from a TypeScript scene script, preserving every line and column. filename is only used in error messages.
Parameters
source
string
filename
string
Returns
string