I’ve got a 3rd party lib I’m trying to use. I’ve installed the library with npm and I’ve installed the types to go with it.
It seems for this particular library I don’t have to write an import statement, it just seems to work and intellisense in VS Code is picking it up.
But then at runtime it can’t be found. If I do put an import statement in, it doesn’t make a difference…
Other 3rd party libs are different, they seem to get bundled with the app and require an import statement.
It all just looks like magic to me, and when the magic doesn’t work I have no idea what to do…
Is there a way to point rollup towards the js file and get it to bundle it with everything else?. How does rollup know what to bundle with 3rd party libs anyway? It just seems to magically find everything in the node_modules directory and pick the right js file in there?
I have no idea how for some libs how on earth they end up working and other ones don’t?
Is there anywhere I can start?
I guess what I want to try and avoid is sticking script tags all through the html file for 3rd party libs, then having another build script which copies them to the www folder. But it makes more sense to me than this huge mess of conventions that when it beraks I don’t know what is going on…
Any help and pointers appreciated!