1.1.4 • Published 2 years ago
pkg-edit v1.1.4
Modify software information after packaging with pkg
how to use
- Introduce pkg-edit in the current project:
npm i -D pkg-edit Initialize configuration information (only needs to be executed once):
npx pkg-edit init, It will generate a pkg.config.js in your projectmodule.exports = { // You need to pay attention to this, this is the exe file generated by pkg file: "./release/build.exe", // ... };You can edit your
package.jsonlike this:{ // ... "scripts": { "build:win": "pkg -t win -o release/build.exe src/index.js && pkg-edit build" // pkg saves the exe file to release/build.exe, pkg-edit will read and modify it according to the configuration } // ... }
can also be used like this
- Execute
npx pkg-editinit in the project directory - You can view
pkg.config.jsand modify some predefined configurations. You must specify thefilefield to point to the exe packaged bypkg - Execute
npx pkg-edit build, it will generate a new exe file according to the content ofpkg.config.js