I am trying to make my Electron app work with the most recent versions of jQuery, Popper and Bootstrap. Unfortunately, neither referencing jQuery, Popper and Bootstrap nor "requiring" them in the <head> section of index.html (renderer process) does work.
I tried (option 1):
<script src='./node_modules/jquery/dist/jquery.min.js'></script>
<script src='./node_modules/@popperjs/core/dist/cjs/popper.js'></script>
<script src='./node_modules/bootstrap/dist/js/bootstrap.min.js'></script>
<link rel='stylesheet' type='text/css' media='screen' href='./node_modules/bootstrap/dist/css/bootstrap.min.css'>
And I tried (option 2):
<script>let $ = require('jquery');</script>
<script>require('popper.js');</script>
<script>require('bootstrap');</script>
<link rel='stylesheet' type='text/css' media='screen' href='./node_modules/bootstrap/dist/css/bootstrap.min.css'>
Anyhow, I would like to maintain nodeIntegration: false if possible. Therefore, I prefer the first option (without require).
I get these errors (option 1):
Uncaught ReferenceError: exports is not defined in "popper.js" ...
index.html:85 Uncaught ReferenceError: $ is not defined ...
And I get there errors (option 2):
Uncaught Error: Cannot find module 'popper.js' ...
jQuery.Deferred exception: $(...).tooltip is not a function TypeError: $(...).tooltip is not a function ...
TypeError: $(...).tooltip is not a function ...
These are the npm packages I am using:
@popperjs/core": "^2.9.2"
"bootstrap": "^5.0.0"
"electron": "^12.0.7"
"jquery": "^3.6.0"
Is there any "best practice" way to include Bootstrap 5.0 (incl. the required "packages" jQuery and Popper) in my Electron app?
PS: I have found many tutorials and hints on the Internet, but none of the approaches I have found seems to work with the most recent version of Bootstrap, etc.