I am aware there is other similar questions such as this one. However mine is quite different.
I would like to know how to import Popper.js using the import
directive. So far I have this on my app.js
(but it does not work yet)
import * as popper from 'popper.js'
window.popper = popper
But I have to mangle every example I find on the Internet with popper.
. Moreover this include takes two lines while the traditional writing window.popper = require('popper.js')
takes only one line.
What is the correct way to import Popper.js and other similar JS libraries?