Bootstrap 4 and RequireJS

I’ve been loading Boostrap 3 via RequireJS without issue. My app.js looked like the following:

However, when attempting to load Bootstrap 4, which requires Popper.js, I kept getting the following error from Bootstrap: “Bootstrap dropdown require Popper.js (https://popper.js.org)” Even though Popper.js was included before Bootstrap in my paths, and I added Popper.js as a dependency in the Bootstrap shim

The issue seems to be that Popper.js is never defined in the global scope. In order to get around that, I did the following, which seems to work:

There might be a more elegant way to handle this, but my knowledge with RequireJS is limited. My application compiled (using Grunt) without issue as well. This issue is also supposed to be resolved in an upcoming Bootstrap release. So, this might only be needed temporarily.