#can bun "--compile" also include the modules? i already tried it but failed

1 messages · Page 1 of 1 (latest)

charred egret
#

i use hono, for the use of my clients internal file system management, so i use packages like fs modules, glob, sharp, pdfjs, etc. but it throw an error says, like this :

error: Cannot find module "./pdf.js/v1.10.100/build/pdf.js" from "B:\~BUN\root\mycli"
charred egret
#

after some investagtion, i found that the pdf-parse requiring the modules like this. but dunno why bun doesn't include this

#

i try to import it, but it still doesnt work

#

i also try to do "copy paste" the missing pdf.js folder into the same level of my index.ts but still doesn't work

#

SOLVED nevermind, already solved hehe

#

i think maybe bun doesn't do run the code when build(?) because options.version declared as default value

#

is this can defined as bug or just a skill issue of the author? @mortal wraith

#

ups, i just realized that the pdfParse can only be invoke if user trigger it. so maybe make sense if bun doesn't know if the options is undefined or not (right ?). but why?

acoustic pagoda
median sky
#

in this case, you could use a Macro to do that concatenation at the build step