wasm-tool / parcel-plugin-wasm.rs

wasm-bindgen support for Parcel bundler
MIT License
66 stars 16 forks source link

Fixed export of enums (fixes #17) #18

Closed josephg closed 5 years ago

josephg commented 5 years ago

This PR adds a rewrite rule check for exported constants, which allows enums to be exported from the wasm-pack bundle.

They appear in the pkg file like this:

export const MyEnum = Object.freeze({ Bar:0,Zot:1, });

And now get exported correctly in the output:

__exports.MyEnum = Object.freeze({
  Bar: 0,
  Zot: 1
});
catsigma commented 5 years ago

thanks for the PR

josephg commented 5 years ago

Thanks for merging!! 😎