I have a npm project that uses jquery.
var $ = require(\'jquery\');
I also have an index html file that references bootstrap.
yarn add bootstrap-sass
yarn add jquery
For style, I use gulp sass which need to include Paths for bootstrap
@import "bootstrap-sprockets";
@import "bootstrap";
var sass = require('gulp-sass');
pipe(sass({includePaths: ['node_modules/bootstrap-sass/assets/stylesheets']}).on('error', sass.logError))
For JavaScript, I assign jquery to window.jQuery as bootstrap-sass needed:
window.jQuery = require('jquery');
require('bootstrap-sass');