JavaScript › ES Modules
What are import maps and what problem do they solve for browser-native ES Modules?
AdvancedAnswer
Import maps let you use bare specifiers (like import 'lodash') directly in the browser without a bundler, by mapping those short names to actual URLs in a <script type='importmap'> block — otherwise browsers require full relative or absolute URLs.
<script type="importmap">
{
"imports": { "lodash": "https://cdn.example.com/lodash.js" }
}
</script>
<script type="module">
import _ from 'lodash';
</script>Real-world example Running a bundler-free, browser-native ES Module app while still using clean package-style import names.