Skip to content

Support non-web wasm targets #4

Description

@WorldSEnder

Currently, the emitted link module is either an ECMAScript module, or a webpack compatible "bundle".

In case of ECMAScript:

  • It uses import to discover the wrapper for the main module
  • It uses export to expose the loader functions.
  • It uses import.meta.url to resolve the wasm sources.

In case of bundle:

  • It imports the wasm file directly to get the exports from the main file
  • It uses export to expose the loader functions
  • It uses import.source(<module path>) to load, then new WebAssembly.Instance(module) to instantiate

More and other targets like deno, bun, node etc could be added.

Metadata

Metadata

Assignees

No one assigned

    Labels

    future-versionAn definite idea or improvement for a future version. Might or might not be planned or in progress.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions