11/11/2023 0 Comments Man installpkgYou can specify a comma-separated list of targets via -targets Pkg can generate executables for several target machines at a The specified package.json and use it as entry file. Packaged app will work the same way as node /path/app.js The entrypoint of your project is a mandatory CLI argument. – Makes executable for particular target machine $ pkg -t node14-win-arm64 index.js – Makes executables for target machines of your choice $ pkg -t node12-linux,node14-linux,node14-win index.js – Bakes '-expose-gc' and '-max-heap-size=34' into executable $ pkg -options "expose-gc,max-heap-size=34" index.js – Consider packageA and packageB to be public $ pkg -public-packages "packageA,packageB" index.js – Consider all packages to be public $ pkg -public-packages "*" index.js – Bakes '-expose-gc' into executable $ pkg -options expose-gc index.js – reduce size of the data packed inside the executable with GZip $ pkg -compress GZip index.js Use -no-dict * to disable all dictionaries -C, -compress compression algorithm = Brotli or GZip Examples: – Makes executables for Linux, macOS and Windows $ pkg index.js – Takes package.json from cwd and follows 'bin' entry $ pkg. Pkg Options: -h, -help output usage information -v, -version output pkg version -t, -targets comma-separated list of targets (see examples) -c, -config package.json or any json file with top-level config -options bake v8 options into executable to run with them on -o, -output output file name or template for several files -out-path path to save output one or more executables -d, -debug show more information during packaging process -b, -build don't download prebuilt base binaries, build them -public speed up and disclose the sources of top-level project -public-packages force specified packages to be considered public -no-bytecode skip bytecode generation and include source files as plain js -no-native-build skip native addons build -no-dict comma-separated list of packages names to ignore dictionaries.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |