galacticcouncil / HydraDX-wasm

Wasm wrapper for hydra pools math
Apache License 2.0
5 stars 1 forks source link

Generate proper es6 modules #2

Open jak-pan opened 3 years ago

jak-pan commented 3 years ago

Currently we are generating invalid ES6 code. We should only have one export. Maybe we can generate 2 separate things for Node.js and Browser scopes respectively?

enthusiastmartin commented 3 years ago

So, i can build for different target.

Please look at the attached files with build packages and let me know if suitable.

web.zip node.zip

jak-pan commented 3 years ago

Actually. We'll need both https://github.com/rustwasm/team/issues/38#issuecomment-361764872 We need to have it working in both Node.js and web and maybe also webpack? As far as I read, this it's about generating proper package.json with proper inputs inside and then we can pack this and use it as a module everywhere.

nohaapav commented 2 years ago

What we need to do is to properly link module & main in package.json .. So in the end we will have 3 modules for

I'll take care of this as SDK is highly dependant on correct packaging of our wasms ;)