Although Bootstrap's documentation suggests that a bundler is necessary to load specific Bootstrap component scripts, it is possible to utilize ES6 imports to control what gets loaded. Thankfully, modern browsers support this feature.
Instead of loading all the extensive distribution files, you can create a customized script that imports only the necessary components aligned with the SCSS files you are using. Here is an example of how this can be achieved:
<head>
<script src="https://cdnjs.../popper.js/.../popper.min.js"></script>
<script type="module">
import '/bootstrap/main/js/dist/tooltip.js';
</script>
<script>
let tooltipTriggerList = []
.slice.call(document.querySelectorAll('[data-bs-toggle="tooltip"]'))
let tooltipList = tooltipTriggerList.map(function(tooltipTriggerEl) {
return new bootstrap.Tooltip(tooltipTriggerEl)
})
</script>
</head>
<body class="p-4">
<p title="A tooltip." data-bs-toggle="tooltip">Hover for a Bootstrap Tooltip.</p>
</body>
Remember, the imported script files must be served with the appropriate CORS headers and MIME type application/javascript
to avoid encountering errors.