@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!

Dependencies (17)

Dev Dependencies (16)

Package Sidebar

Install

npm i @xyh19/rollup-plugin-wasm

Weekly Downloads

0

Version

1.0.4

License

MIT

Unpacked Size

131 kB

Total Files

9

Last publish

Collaborators

  • xyh19