I'm trying to import the Politespace library into a Webpack project. It's written such that on a certain line it tries to attach a global Politespace object to the window object, which is needed for an event listener on the document object to correctly behave.
But when trying to load this in Webpack by putting an import into vendor.js I'm seeing that w comes out as just an object - it seems like Webpack is substituting a different variable, so that it's never attached to the window.
Is there a way to allow importing libraries that assign global properties to Window, other than having to copy and paste the file and modify it to refer specifically to the window rather than w (which I've verified does work)?