@xyh19/rollup-plugin-wasm
TypeScript icon, indicating that this package has built-in type declarations

1.0.4 • Public • Published

rollup-plugin-wasm 👋

Version rollup License: MIT

Rollup plugin to bundle wasm module. Support assemblyScript, emscripten, golang. Support vite.

🏠 Homepage

install

npm i -D @xyh19/rollup-plugin-wasm
# or
yarn add -D @xyh19/rollup-plugin-wasm

Getting Started

Create a rollup.config.js configuration file and import the plugin:

// rollup.config.js
import wasm from '@xyh19/rollup-plugin-wasm'
import path from 'path'

export default {
  input: 'src/index.js',
  output: {
    dir: 'output',
    format: 'cjs',
  },
  plugins: [
    wasm(),
  ],
}

Configuration

inline

  • Type: boolean | number | ((fileName: string, id: string) => boolean | Promise<boolean>)

Inline webassembly directly in source code.

useInstanceFactory(experimental)

  • Type: boolean | CustomWebAssemblyInstanceFactory

debug(experimental)

  • Type: boolean Enable debug mode.

target

  • Type: undefined | 'node'

asc

AssemblyScript compile.

emscripten(experimental)

Emscripten compile.

golang

golang compile.

🤝 Contributing

Contributions, issues and feature requests are welcome!
Feel free to check issues page.

Show your support

Give a ⭐️ if this project helped you!

Versions

Current Tags

VersionDownloads (Last 7 Days)Tag
1.0.41latest

Version History

VersionDownloads (Last 7 Days)Published
1.0.41
1.0.30
1.0.20
1.0.10

Package Sidebar

Install

npm i @xyh19/rollup-plugin-wasm

Weekly Downloads

1

Version

1.0.4

License

MIT

Unpacked Size

131 kB

Total Files

9

Last publish

Collaborators

  • xyh19