Just an update, I found a quick and dirty way to achieve this:
<script type="module">
import * as PIXI from './pixi.mjs';
window.PIXI = PIXI;
</script>The pixi library can now be accessed from c++ by using 'emscripten::val pixi = val::global("PIXI")
'This isn't a good solution since it makes PIXI global including it inside the window object. I think there are better ways to do this, but I couldn't find any on the official emscripten documentation.