I have a project that include a gulp task for building and packaging the sources and release in a directory called dist. My goal is publish it as a npm package,
If you are (and I recommend) using semantic-release, add the pkgRoot option in the .releaserc.json file:
{
"pkgRoot": "dist",
"plugins": [
"@semantic-release/commit-analyzer",
"@semantic-release/release-notes-generator",
"@semantic-release/npm",
[
"@semantic-release/exec",
{
"prepareCmd": "npx rjp package.json version nextRelease.version"
}
],
[
"@semantic-release/git",
{
"assets": ["package.json"]
}
],
],
}
That'll take care of the problem. Just make sure your dist folder contains a package.json file. You can easily do that by adding a cp to your postbuild script. Also install rjp