Skip to content

derivePreloadPaths

derivePreloadPaths(files?): string[]

Defined in: packages/runtime/src/wasm/create-wasm-bin.ts:64

Derive a deduplicated preload-path list from an Extension’s files map.

Every file path and its parent directory is added so wasmExec pre-creates the directory tree in MEMFS before copying files in.

Record<string, string>

Optional map of absolute path → file contents.

string[]

Sorted-insertion-order array of paths to preload; [] if files is undefined.

const paths = derivePreloadPaths({ '/etc/vimrc': '...', '/usr/share/vim/defaults.vim': '...' })
// → ['/etc/vimrc', '/etc', '/usr/share/vim/defaults.vim', '/usr/share/vim']

createWasmBin