JavaScript · Senior · Question 70 of 75
What does <script type="importmap"> enable?
<script type="importmap">
{ "imports": { "lodash": "https://cdn.example/lodash-es.js" } }
</script>- ✓Correct answer: Using bare specifiers like
import "lodash"in the browser without a bundler - 2Bundling modules into one file
- 3Loading CommonJS modules
Explanation
Import maps map names to URLs and can also scope versions. They are used for no-build setups and micro-frontends sharing dependencies.