yao-pkg / pkg

Package your Node.js project into an executable
https://www.npmjs.com/package/@yao-pkg/pkg
MIT License
312 stars 11 forks source link

Reconsider `deployFiles` in `sharp` and other dictionaries #39

Open segevfiner opened 6 months ago

segevfiner commented 6 months ago

What version of pkg are you using?

5.11.4

What version of Node.js are you using?

18.9.1

What operating system are you using?

macOS

What CPU architecture are you using?

Apple M1

What Node versions, OSs and CPU architectures are you building for?

default

Describe the Bug

We have deployFiles for some module dictionaries that only really point at *.node files that can safely be bundled if they are included in assets, for example for sharp. Reconsider moving those to assets.

Expected Behavior

Don't tell to copy/deploy directories when not really needed

To Reproduce

Bundle a package that uses sharp or other modules that have deployFiles set.

robertsLando commented 6 months ago

👍🏼

Tiarait commented 1 month ago

Oh you made my day, thank you! I kept getting error Error: Could not load the "sharp" module using the win32-x64 runtime but turns out I just had to put "node_modules/@img/sharp-win32-x64/**/*" into assets in config pkg