A Rollup plugin (v2.0.0) that imports AssemblyScript (.as) files and compiles them on-the-fly into WebAssembly modules. It supports custom compiler options, a configurable import matcher (default `asc:` prefix), and optional integration with as-bind for high-level type bindings. Distinct from other WASM plugins by targeting AssemblyScript specifically and offering tight rollup integration. Requires AssemblyScript and as-bind as peer dependencies. Maintained by the AssemblyScript team.
npm install rollup-plugin-assemblyscriptVerified import paths — ran on the pinned version, not inferred.
Shows minimal rollup config using asc plugin with compiler options, default matcher, and as-bind disabled.
Use ESM imports or dynamic import('rollup-plugin-assemblyscript').Change imports from `assemblyscript:./file.as` to `asc:./file.as`.
npm install assemblyscript as-bind
Use the URL with WebAssembly.instantiateStreaming or fetch.
Ensure as-bind is installed and use `import * as wasm from 'asc:./file.as'` to get bindings.
Run: npm install rollup-plugin-assemblyscript
Use: import { asc } from 'rollup-plugin-assemblyscript'If using v1: import asc from 'rollup-plugin-assemblyscript'
If using v2: import { asc } from 'rollup-plugin-assemblyscript'Correct usage: plugins: [asc()] (call the function), not plugins: [asc]