Importing trackingjs third party library

I found a way to access the library in my app and with no errors in the editor. The solution was provided by @mikewagz in Importing external libraries

I now import trackingjs like this:

import 'tracking';

All this does is include the library via Webpack and it gives me access to the global named tracking (actually obviously window.tracking as created by the library), without error messages in the editor.

Somehow this is very unsatisfying… and it seems wrong.

Can someone shed some light on how/if it could be improved and how things actually work under the hood?


PS: there is not need to specify the full path to the library file (as written in my question).