Skip to content

feat(wasm): direct .wasm imports (WASM ESM Integration)#21779

Merged
sapphi-red merged 6 commits into
vitejs:mainfrom
Menci:feat/wasm-esm-integration
Jun 11, 2026
Merged

feat(wasm): direct .wasm imports (WASM ESM Integration)#21779
sapphi-red merged 6 commits into
vitejs:mainfrom
Menci:feat/wasm-esm-integration

Conversation

@Menci

@Menci Menci commented Mar 8, 2026

Copy link
Copy Markdown
Contributor

Add support for importing .wasm files directly without the ?init suffix, by the WASM ESM Integration draft standard. The plugin parses wasm binary to extract imports/exports, generates appropriate glue code, and handles both dev and SSR build modes.

close #4551

Add support for importing .wasm files directly without the ?init suffix.
The plugin parses wasm binary to extract imports/exports, generates
appropriate glue code, and handles both dev and SSR build modes.
@Menci

Menci commented Mar 8, 2026

Copy link
Copy Markdown
Contributor Author

This relies on fix #21780 to be checked-in first. Ready!

@Menci Menci changed the title feat(wasm): support direct .wasm imports (WASM ESM Integration) feat(wasm): direct .wasm imports (WASM ESM Integration) Mar 12, 2026
@sapphi-red sapphi-red added this to the 8.1 milestone Mar 16, 2026
@sapphi-red sapphi-red added feat: wasm p2-nice-to-have Not breaking anything but nice to have (priority) labels Jun 2, 2026

@sapphi-red sapphi-red left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

I added some changes:

  • removed wasm-fallback plugin: it's no longer needed as .wasm is now handled
  • added docs for this new feature

@pkg-pr-new

pkg-pr-new Bot commented Jun 11, 2026

Copy link
Copy Markdown

Open in StackBlitz

@vitejs/plugin-legacy

pnpm add https://pkg.pr.new/@vitejs/plugin-legacy@21779 -D
npm i https://pkg.pr.new/@vitejs/plugin-legacy@21779 -D
yarn add https://pkg.pr.new/@vitejs/plugin-legacy@21779.tgz -D

vite

pnpm add https://pkg.pr.new/vite@21779 -D
npm i https://pkg.pr.new/vite@21779 -D
yarn add https://pkg.pr.new/vite@21779.tgz -D

commit: f5cb1c7

@sapphi-red sapphi-red merged commit c23d85b into vitejs:main Jun 11, 2026
29 of 30 checks passed
graphite-app Bot pushed a commit to rolldown/rolldown that referenced this pull request Jun 15, 2026
Remove `rolldown_plugin_vite_wasm_fallback` because it is not used after vitejs/vite#21779.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

feat: wasm p2-nice-to-have Not breaking anything but nice to have (priority) trigger: preview

Projects

None yet

Development

Successfully merging this pull request may close these issues.

"ESM Integration proposal for Wasm" support

2 participants