feat: Adding publicPath option for npm publishConfig #1010
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Adds the
publicPath
option to thenpm.publishConfig
configuration item to facilitate custom configuration and meet the needs of users in certain scenarios.At present, after
npm publish
succeeds, the npm package address displayed in the terminal printout log ishttps://{{host}}/package/{{packageName}}
, through thispublicPath
option allows/package
replace it with a custom path.For example, when using a third-party tool
Verdaccio
to build an npm private proxy , The package address of Verdaccio web user interface is fixed and cannot be configuredhttps://{{host}}/-/web/detail/{{packageName}}
, In this case,npm.publishConfig.publicPath
can can be configured as-/web/detail
.Then the terminal will print the address
https://{{host}}/-/web/detail/{{packageName}}
afternpm publish
done , the user can directly click on the npm package address printed in the terminal output log to access the web user interface ofVerdaccio
, enhanced user experience.