Loading ar.js and three.js with webpack problem

I’m struggling with loading ar.js into my project, where I use webpack.

The problem is, that I’m using the modular approach for loading three.js and all the other libraries:
import * as THREE from 'three';
but the ar.js is for simple loading trough
<script src="...">
what leads to error: ReferenceError: THREE is not defined

I found some old posts on exposing THREE for the ar.js, or updating ar.js to be modular, so it could be imported the right way, but can’t make it work. Don’t you guys have some boilerplate for three.js and ar.js using webpack? Thanks!

I think you should upvote the following issues at GitHub: