Created by: Johann-S
I continue my todo list for v5.
Our main dist file will be available as a module and next step we'll have to build our plugins in ESM too.
Not sure about building our modules in ESM too because they are available separately.
What does it add for our users ?
use Bootstrap as a module in their browser
<script type="module">
import { Toast } from 'bootstrap.esm.min.js'
Array.from(document.querySelectorAll('.toast'))
.forEach((toastNode) => new Toast(toastNode))
</script>
And bundlers will load the ESM version because we added module
in our package.json
TODO:
-
See if we need the babel object spread plugin for our target browsers -
Explain the known issue with the plugins that require Popper and link to https://developers.google.com/web/fundamentals/primers/modules#package-name-maps. Maybe make this an info/warning callout