Tree shaking
skoropadas opened this issue · 2 comments
Hey, the library looks sick! Could you tell me if are you gonna make it tree-shakable?
I now need basically only a formatter for HTML in the browser, but as far as I understand, all the functionality is loaded now, because it's in one compiled js file.
Hey @skoropadas
So the distribution size for the module is 56kb (gzipped) which is relatively small overall. I don't have any plans to make it tree-shakable as it's all just a single bundle and each of the lexers are required to perform embedded code region formatting support, eg: <style>
and <script>
tags. The module is still heavily in development, so things will likely get smaller over time.
You can leverage ESM and load in Æsthetic externally. I have a pattern for this in Moloko.
@panoply Got it! Cool! I'm just worried that over time the package may get bigger and start taking up more space in the bundle.
I'll check your pattern, thank you!