Allow publishing from a specific folder using publishPath attribute - #102
Allow publishing from a specific folder using publishPath attribute#102thivi wants to merge 1 commit into
publishPath attribute#102Conversation
|
Thanks for the PR! This is a fairly unconventional use case you're asking for, and one that could likely be accomplished by using the conventional mechanism npm uses. Would this not work for you? |
|
Hi @scalvert, Thank you for your swift response. The problem with the above approach is that you can't publish the content of a folder. Instead, you will be publishing the folder itself. For example, let's assume that the structure of my repo is as follows: I want to publish the content of the Instead, I want the npm pack to look like this: Release It actually supports this using the |
|
Thank you, @scalvert! |
Allow an individual workspace to be published from a subdirectory (e.g. `dist`) by setting a `publishPath` field on its `package.json`. When present, the publish command runs from `<package>/<publishPath>` instead of the package root. The version bump is still written to the workspace's own `package.json`, so the build that produces the published folder is responsible for including an up-to-date manifest. Originally proposed in #102 by @thivi. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This is to allow publishing only a specific folder from within a package. In order to publish a specific folder, developers can add the following attribute to the relevant package's
package.jsonfile:This will run the
npm publishcommand from within thedistfolder, allowing only the content of this directory to be published.