Another question: I am trying to integrate with He...
# javascript
m
Another question: I am trying to integrate with Here Maps which they have a js bundle ("https://js.api.here.com/v3/3.1/mapsjs.bundle.js"). It doesn't have a module name in the bundle. Is there an example on how I can include third-party scripts and use them in kotlin js? I read the documentation but my JS knowledge is quite limited. Thanks and congrats for the great work! 😉
a
Just drop it into
resources
alongside
index.html
and put reference inside
index.html
m
thanks, will try that! Particle physics and kotlin and JBR ... I should trust you! 🙂 .
a
Nothing about JS there. So don't rush it. Still, everything in resources directory is loaded directly to the distribution directory bypassing the bundler and you can use both js, css and data files there
m
I was always putting them (external declarations) in jsMain and tried to load the bundle from the index.html but it didn't work. Will try that. I take it slowly anyways. Pressure is no good for learning 🙂. Thanks! May you redefine the standard model! 🙂
a
Everythig in kotlin is being compiled and bundled with webpack. Some names are mangled in process and it is not easy to access them from html. On the other hand files in resources are copied as-is. So you can work with them as with any JS filed. If you have Idea Ultimate, you will also have full coding support for those files.
m
Yes, I have Ultimate. I am a JB fun 🙂
It worked like a charm. Thanks a bunch!