Package Exports
- bootstrap-esm
- bootstrap-esm/dist/bootstrap.js
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (bootstrap-esm) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
bootstrap-esm
ES Module version of Bootstrap v5 with tree shaking support for optimized code.
Notes: This package is intended for use by bundlers.
Bootstrap version used: v5.3.6
Why ?
- Because
import { Button } from 'bootstrap'
does not perform tree shaking. See https://github.com/twbs/bootstrap/issues/37575 - Because I don't want to install
@types/bootstrap
.bootstrap-esm
includes types.
Usage / Example
npm install bootstrap-esm
import { Tooltip } from 'bootstrap-esm'
document.querySelectorAll('[data-bs-toggle="tooltip"]').forEach((element) => {
new Tooltip(element)
})