But for some reason that gets exported on exports rather than __exports:
const MyEnum = Object.freeze({
Bar: 0,
Zot: 1
});
exports.MyEnum = MyEnum;
// Everything else is on __exports, and works fine!
__exports.some_fn = function (f) {
// ...
};
__exports.__wbindgen_throw = function (ptr, len) {
throw new Error(getStringFromWasm(ptr, len));
};
// ... etc.
As a result the exported enum is unavailable in the bundled code. I have no idea if this is a bug in parcel or if its an issue in babel or something.
Given rust code which exports an enum:
The bindgen compiled code contains this:
But for some reason that gets exported on
exports
rather than__exports
:As a result the exported enum is unavailable in the bundled code. I have no idea if this is a bug in parcel or if its an issue in babel or something.
Using the latest versions of everything: