4 ms·
By being declarative instead of imperative: - The dependencies of a module can be scraped without running the code - The subset of declarations used in an imp
by brundolf 3y ago
By being declarative instead of imperative:
- The dependencies of a module can be scraped without running the code
- The subset of declarations used in an import can be known
This allows modules to be loaded in parallel, and also allows for things like tree-shaking. The biggest benefits are for web browsers, but all around it's a more constrained way to express dependencies, which allows the bundler/runtime to take more liberties.