Closed TomokiMiyauci closed 1 year ago
Could you please expand on this
@okikio For example, the following will result in a bundle result of 0. Unused modules will be removed.
import { Result } from "https://deno.land/x/result_js/mod.ts";
This result is correct if i want to know the "bundled result".
My expectation was that the above example would allow me to measure the cost. For example, the following is available: https://github.com/wix/import-cost
This is due to differences in project policies. I realized that what I sought was not the role of this project.
@TomokiMiyauci In a future version having each import display their size write in the bundle may be added as an extra feature, but as of right now you're correct it's a little bit out of scope.
The one thing bundlejs does have is bundle analysis https://twitter.com/okikio_dev/status/1523562099334541313?s=20&t=JPPB2KIF8Wv1tQrJI5rm7w
You can try out bundle analysis https://bundlejs.com/?q=deno:result_js/mod.ts&treeshake=[{+Result+}]&config={"analysis":true}
^ It's not perfect, it doesn't give a perfect treeshake size
@okikio interesting!
^ It's not perfect, it doesn't give a perfect treeshake size
Indeed, the rendering of treemap seems to succeed only once in several times.
It seems to recognize the module by its
export
identifier.This is a bit odd.
Also, it adds an
export { xxx }
to the analysis results, which is not needed for actual use, and does not indicate the exact size.