#1294·shiki

Offline usage, bundle or otherwise

Author: UtopiahCreated Jul 5, 2026Updated Jul 5, 2026

Hi,

I used shiki in the past, relying on [email protected] via esm.sh thanks to which I got highlighter.codeToTokens() and was able to do syntax highlighting in VR.

I tried few times to get it to work offline but without success, namely :

So I downloaded the latest repository, built using a container (to insure node and pnpm were latest), and got a ~60MB packages directory with shiki, core and the bundles in.

If I try to load it it directly in a bare index.html (behind HTTPS but not nodejs, build system, etc) I get bare identifier missing. I tried with an importMap but then a lot of dependencies still seem to be missing, e.g. zwitch, hast-util-to-html, etc an unknown number more.

Clearly I'm not doing something right. How can I use Shiki offline?