Menci / vite-plugin-wasm

Add WebAssembly ESM integration (aka. Webpack's `asyncWebAssembly`) to Vite and support `wasm-pack` generated modules.
MIT License
281 stars 16 forks source link

fix: improve CJS Interoperability #50

Closed magic-akari closed 7 months ago

magic-akari commented 7 months ago

This pull request resolves two issues:

  1. Improves interoperability with CommonJS by utilizing the import namespace syntax.
  2. Avoid creating invalid import name bindings.

In JavaScript, not all export names can be used as valid variable names. For example:

const a = 42;

export { a as "🥰" };