cardano-serialization-lib icon indicating copy to clipboard operation
cardano-serialization-lib copied to clipboard

Minify ASM package

Open mahnunchik opened this issue 3 years ago • 4 comments

It would be helpful to have @emurgo/cardano-serialization-lib-asmjs package be minimized by default.

  • Current size of cardano_serialization_lib.asm.js: 17.4 Mb
  • Minimized size: 4.52 Mb

mahnunchik avatar Apr 04 '22 08:04 mahnunchik

How did you perform the minimization?

johnrichardrinehart avatar Jun 09 '22 10:06 johnrichardrinehart

@johnrichardrinehart I perform the minimization by monkey patch: https://github.com/CoinSpace/cs-cardano-wallet/blob/master/webpack.config.js

mahnunchik avatar Jun 09 '22 13:06 mahnunchik

I was confused because this webpack didn't seem to do anything with your index.js, but I understand, now. webpack is only being used with some Terser/minification webpack modules/pipes to shrink the Cardano serialization library WASM for your import: https://github.com/CoinSpace/cs-cardano-wallet/blob/8e896d9e0422e33cd9a36390f8929f3575ce97eb/index.js#L230-L244 . Totally makes sense.

Thanks a lot! I've starred :smile: .

johnrichardrinehart avatar Jun 09 '22 14:06 johnrichardrinehart

Yes, it is correct 😉

mahnunchik avatar Jun 09 '22 14:06 mahnunchik