denoland / deno

A modern runtime for JavaScript and TypeScript.
https://deno.com
MIT License
93.98k stars 5.23k forks source link

Add support for node native addons / FFI in `deno compile` #23266

Open marvinhagemeister opened 5 months ago

marvinhagemeister commented 5 months ago

Discussed in https://github.com/denoland/deno/discussions/23255

Originally posted by **babakfp** April 6, 2024 Hi 👋 https://github.com/parcel-bundler/lightningcss/discussions/712 Based on this comment https://github.com/parcel-bundler/lightningcss/discussions/712#discussioncomment-9029656 and this: ![Screenshot 2024-04-06 223807](https://github.com/denoland/deno/assets/44144724/d10c2985-f70a-489e-9ffd-11f9157b20e3) (I used this library https://deno.land/x/abc@v1.3.3 and when I compiled, it started to download this ^ file). It seems like Deno doesn't do the same for lightningcss.
bartlomieju commented 5 months ago

I don't expect this to work. FFI/native Node extensions can't be included in the the compiled binary.

AddictArts commented 2 months ago

As a data point I ran into similar with electron-builder and now with deno. For elextron-builder I used asar.upacked which essentially put a node_modules and native within. Seems like deno should or maybe could do the same?