Kirby CMS with MapLibre GL library

Hi there,

I’m trying to implement a MapLibre GL map on my Kirby website but I can’t seem to make it work.

Since the MapLibre GL library is installed through NPM, I was first wondering wether it is at all possible to import a node_module within a Kirby project.

If so, how should I proceed? I’ve installed the library using npm install maplibre-gl as advised in the MapLibre GL JS documentation. I haven’t worked with a package manager before, so I am lost. How can I link the maplibre library as well as its depedencies to my Kirby project?

Thank you in advance for your help,
NG

Well, this has absolutely nothing to do with Kirby, and you would do it exactly like in a static website.

If you want to use npm and imports, you need a bundler.

Otherwise, fall back to loading the script from CDN, or download the files and include via script tags.

1 Like

Thank you <3