How to workaround `deno compile` binary file limitations?
In my app I'm using
sharp
and after compile it looses the ability to load dll.
Is there any way to workaround this problem?2 Replies
DLLs are not supported in
deno compile
right now. Sadly there's no workaround atmWell theres one hacky workaround.
I made a tool last year https://deno.land/x/binaryify that lets us ES import .dylib files as a Uint8Array. We can then write that array to a temp file at runtime and then
dlopen
that file.
It would look like:
1. Install binaryify
2. Run binaryify -- ./your.dylib
3. Instead of calling .dlopen do
Binaryify (as of today) will auto-update the "./your.dylib.binaryified.js"
file every time time the "./your.dylib"
file changes