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/core@2.11.8/dist/esm/popper.min.js",
"bootstrap": "https://cdn.jsdelivr.net/npm/bootstrap@5.3.2/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