Skip to content

Commit 357b0af

Browse files
authored
fix: pass prefix and workspaces to libnpmpack (#4917)
1 parent dc38ab9 commit 357b0af

File tree

2 files changed

+11
-2
lines changed

2 files changed

+11
-2
lines changed

lib/commands/pack.js

+5-1
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,11 @@ class Pack extends BaseCommand {
4444
// noise generated during packing
4545
const tarballs = []
4646
for (const { arg, manifest } of manifests) {
47-
const tarballData = await libpack(arg, this.npm.flatOptions)
47+
const tarballData = await libpack(arg, {
48+
...this.npm.flatOptions,
49+
prefix: this.npm.localPrefix,
50+
workspaces: this.workspacePaths,
51+
})
4852
const pkgContents = await getContents(manifest, tarballData)
4953
tarballs.push(pkgContents)
5054
}

lib/commands/publish.js

+6-1
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,12 @@ class Publish extends BaseCommand {
8080
}
8181

8282
// we pass dryRun: true to libnpmpack so it doesn't write the file to disk
83-
const tarballData = await pack(spec, { ...opts, dryRun: true })
83+
const tarballData = await pack(spec, {
84+
...opts,
85+
dryRun: true,
86+
prefix: this.npm.localPrefix,
87+
workspaces: this.workspacePaths,
88+
})
8489
const pkgContents = await getContents(manifest, tarballData)
8590

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

0 commit comments

Comments
 (0)