Cara bundle package nodejs menggunakan pkg

npm install -g pkg

Targets

pkg can generate executables for several target machines at a time. You can specify a comma-separated list of targets via --targets option. A canonical target consists of 3 elements, separated by dashes, for example node6-macos-x64 or node4-linux-armv6:

  • nodeRange node${n} or latest
  • platform freebsd, linux, alpine, macos, win
  • arch x64, x86, armv6, armv7

Untuk Mac OS
npx pkg . --targets node12-macos-x64
Untuk Windows
npx pkg . --targets node12-win-x64
npx pkg . --targets node12-win-x86

Posting Komentar

Lebih baru Lebih lama