Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: pass prefix and workspaces to libnpmpack #4917

Merged
merged 1 commit into from May 19, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
6 changes: 5 additions & 1 deletion lib/commands/pack.js
Expand Up @@ -44,7 +44,11 @@ class Pack extends BaseCommand {
// noise generated during packing
const tarballs = []
for (const { arg, manifest } of manifests) {
const tarballData = await libpack(arg, this.npm.flatOptions)
const tarballData = await libpack(arg, {
...this.npm.flatOptions,
prefix: this.npm.localPrefix,
workspaces: this.workspacePaths,
})
const pkgContents = await getContents(manifest, tarballData)
tarballs.push(pkgContents)
}
Expand Down
7 changes: 6 additions & 1 deletion lib/commands/publish.js
Expand Up @@ -80,7 +80,12 @@ class Publish extends BaseCommand {
}

// we pass dryRun: true to libnpmpack so it doesn't write the file to disk
const tarballData = await pack(spec, { ...opts, dryRun: true })
const tarballData = await pack(spec, {
...opts,
dryRun: true,
prefix: this.npm.localPrefix,
workspaces: this.workspacePaths,
})
const pkgContents = await getContents(manifest, tarballData)

// The purpose of re-reading the manifest is in case it changed,
Expand Down