|
|
|
|
|
by slinger
1141 days ago
|
|
I think you're right but if you need treeshaking, some sorting of pack (minification of variable names, etc) or jsx you would still need a build step. I don't know if treeshaking and pack are that relevant for most people tho |
|
Beyond that ESM "module objects" (the proxy that the import represents and is most directly seen in an `import * as someModule` style import) in most of the browsers are also built to be readonly treeshakeable things in that they may not be immediately JIT compiled and are generally subject to garbage collection rules like everything else, and being readonly proxies may garbage collect sooner than average. So the browser will lazily "treeshake" by garbage collection at runtime in a running app. (Though if you are relying heavily on that it likely means your modules are too big and you should consider smaller, looser, less packed modules and relying on the first bit where stuff not imported is never seen by the browser.)