I mean, sure, that’s probably heavily influenced by the need for bundling for the frontend.

But it isn’t done blindly. Bundlers reduce the overall size of the code, either due to minification or tree-shaking (removing unused modules). It also removes the filesystem overhead of resolving and opening other modules.

Would bundling be useful in other interpreted languages?

I suppose you may count JVM’s compilation to bytecode as being very similar.

  • CyclohexaneOP
    link
    fedilink
    arrow-up
    1
    ·
    10 months ago

    In nodejs, at least, it does. The minification and tree-shaking can make code significantly smaller. This can mean smaller cold start time in AWS Lambda for example, or just overall a little less RAM. If your heap isn’t that large, that can be noticeable.

    It also eliminates the filesystem overhead of resolving and loading modules.