Docs
CLI
Prepublish

Prepublish

Running some preparation for publishing NAPI-RS packages.

💡

This command is usually used in prepublishOnly lifecycle scripts in package.json.

package.json
"scripts": {
  "prepublishOnly": "napi prepublish -t npm"
}

Flags

FlagType/Default ValueDescription
--tagstyle,-tString/lernaThe tag style of your git commit. We support two types of styles for now: npm and lerna. For example, if you change your package version by npm version patch, the latest commit will be v1.2.1. And the napi prepublish -t npm command will collect the version information from the latest commit message. And this information will be used to upload artifacts into GitHub Releases.
If the --skip-gh-release is provided, the --tagstyle,-t will have no effect.
--skip-gh-releaseBoolean/falseWhether to skip upload platform binary into GitHub Relaese.
-p,--prefixString/npmThe path in which the platform packages are. @napi-rs/cli will update all the package.json files in it. Bump the version field to align the package.json in the root of project.
-c,--configString/undefinedThe package.json file path to read, relative to the process.cwd().
The package.json file must contains the napi config field.
@napi-rs/cli will write optionalDependencies filed into the package.json, and the optionalDependencies contains all the platform defined in napi.triples filed.