Skip to content

Instantly share code, notes, and snippets.

@akolinski
Last active January 29, 2024 22:07
Show Gist options
  • Save akolinski/866e9d55f3d1c996485abe74f88ddb13 to your computer and use it in GitHub Desktop.
Save akolinski/866e9d55f3d1c996485abe74f88ddb13 to your computer and use it in GitHub Desktop.
If you want to include Bootstrap 5 in a modular way using single-line imports, you can do it like this.
<script type="importmap">
{
"imports": {
"@popperjs/core": "https://cdn.jsdelivr.net/npm/@popperjs/[email protected]/dist/esm/popper.min.js",
"bootstrap": "https://cdn.jsdelivr.net/npm/[email protected]/dist/js/bootstrap.esm.min.js"
}
}
</script>
<script type="module">
import { Alert, Button, Carousel, Collapse, Dropdown, Modal, Popover, ScrollSpy, Tab, Toast, Tooltip } from 'bootstrap';
</script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment