Skip to main content

<pc-module>

The <pc-module> tag is used to load a WebAssembly module.

Usage
  • It must be a direct child of <pc-app>.

Attributes

AttributeTypeDefaultDescription
fallbackString-Path to fallback (asm.js) code when WebAssembly is not supported
glueString-Path to the JavaScript glue code for the module
nameString-Module name used to reference it in scripts
wasmString-Path to the WebAssembly (.wasm) file

Example

<pc-app>
<!-- Load the ammo.js module -->
<pc-module name="ammo" glue="ammo.wasm.js" wasm="ammo.wasm.wasm" fallback="ammo.js"></pc-module>
</pc-app>

JavaScript Interface

You can programmatically create and manipulate <pc-module> elements using the ModuleElement API.