I just noticed that my Javascript bundles were unnecessarily large, so I started inspecting and I found that the named imports were not behaving as expected.
For example, doing:
import {Modal} from "bootstrap";
should only import the single component, but in my case, it bundling the entirety of the bootstrap package, resulting in a 200KB bundle.
If I do this instead:
import Modal from "bootstrap/src/modal"
Then I get a 40KB bundle as expected. Could you please let me know where I might be wrong and how I could fix this?
I have created a minimal reproducible example here: