Configure Yarn to publish packages to Artifactory by adding the target repository to the package.json file. You can also specify the target repository in the yarn publish command to override the configured target repository.
To publish a package to Artifactory:
Add the following snippet to the
package.jsonfile:"publishConfig": { "registry": "[JFrogPlatformURL]/artifactory/api/npm/<REPO_NAME>/" }Where:
[JFrogPlatformURL]: The URL of your JPD<REPO_NAME>: The name of the target repository
For example:
"publishConfig": { "registry": "https://company.jfrog.io/artifactory/api/npm/npm-local/" }Run the following command:
yarn publish
To publish to a specific repository:
Run the following command:
yarn publish --registry [JFrogPlatformURL]/artifactory/api/npm/<REPO_NAME>/Where:
[JFrogPlatformURL]: The URL of your JPD<REPO_NAME>: The name of the target repository
For example:
yarn publish --registry https://company.jfrog.io/artifactory/api/npm/npm-local/