Maintenance Guide
A plugin for rolldown-vite that helps load .wasm?init files by converting them into proper JavaScript initialization code, ported from Vite's wasmHelperPlugin.
This plugin is exclusive to rolldown-vite and is not recommended for external use.
📦 What it does
This plugin enables the loading of .wasm?init imports by creating a wrapper JavaScript module that initializes the WebAssembly module at runtime.
It uses a virtual helper module (\0vite/wasm-helper.js) to handle the instantiation and setup of the WebAssembly module.
✅ Examples
import init from './module.wasm?init';
init().then(instance => {
// use instance.exports...
});
Will be transformed to something like:
import initWasm from '\0vite/wasm-helper.js';
export default opts => initWasm(opts, 'assets/module-HASH.wasm');
🚀 Debug Usage
import from 'rolldown';
import from 'rolldown/experimental';
export default ;