import jquery from 'jquery'
window.$ = window.jQuery = jquery;
import 'bootstrap';
doesn't really work because webpack (what we use) moves all import statements to the top. That can be solved by import bootstrap with require('bootstrap');
though.However, the more challenging and annoying part are plugins because jQuery uses it's own plugin registry ($.fn). Most of the plugins are so nice to require it if require is available. But, the things you get from require are cached, thus, if you do
const $ = require('jquery');
$.fn.yada = ...
your registered function will not be available to other jQuery imports.Long story short, what's so annoying about this technology is the fact that it does not fit the modularized setups very well but you are forced to find a way for it to work when you want to use bootstrap with the JavaScript additions.