Fork me on GitHub
#shadow-cljs
<
2023-02-25
>
James Amberger20:02:15

Hi everyone. Try as I might I can’t seem to get pdf.js working via shadow-cljs. I tried a variety of :requires, such as

(ns fdny.lss.evds
  (:require ["pdfjs-dist" :as pdf]))
I needed :js-provider :require to even compile, and pdf evals to {} in the repl.

thheller20:02:47

I made an example using the CDN version a while ago

👍 2
thheller20:02:41

pdfjs is not exactly build tool friendly, so CDN is the safer option

James Amberger20:02:25

hm. My application will have to work offline however

James Amberger20:02:52

but I could cache the content from the CDN

James Amberger20:02:59

thanks @U05224H0W, for everything

thheller20:02:21

you can just take the files out of the npm package too

thheller20:02:27

IIRC there was a dist dir

James Amberger20:02:54

that might be the way to go