Comparison
ES modulevsImport map
ES module
you wrote `import` at the top of the file and the tooling could tell what you used without running anything.
The standard module format, with static `import` and `export` declarations that can be analysed without executing the file. That static shape is what makes tree shaking possible at all, and it is why dynamic imports are the only conditional form allowed. Modules are strict mode, deferred, and evaluated once, which is why a module-level variable is a singleton whether you meant it to be or not.
Full entry →Import map
you told the browser directly what `react` resolves to and skipped the bundler for that import.
A script block that maps bare module specifiers to URLs, letting the browser resolve imports without a build step. It makes native modules workable for small applications and for pinning a shared dependency across independently built pieces. It does not solve the thing bundlers were built for — request count and waterfalls through deep dependency chains — so it complements a build rather than replacing one.
Full entry →