diff options
author | nlf <quitlahok@gmail.com> | 2022-05-20 00:20:18 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-05-20 00:20:18 +0300 |
commit | 357b0af2af2b07a58d2d837043d1d77c9495d8b5 (patch) | |
tree | be586b66d7ccdff52dc728a9512c6beddb6d7805 /lib | |
parent | dc38ab96fca99069449e6c5e492062b94a1264b6 (diff) |
fix: pass prefix and workspaces to libnpmpack (#4917)
Diffstat (limited to 'lib')
-rw-r--r-- | lib/commands/pack.js | 6 | ||||
-rw-r--r-- | lib/commands/publish.js | 7 |
2 files changed, 11 insertions, 2 deletions
diff --git a/lib/commands/pack.js b/lib/commands/pack.js index 41fef5cb4..8190ceeca 100644 --- a/lib/commands/pack.js +++ b/lib/commands/pack.js @@ -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) } diff --git a/lib/commands/publish.js b/lib/commands/publish.js index cbf0ccf4d..da6437fa9 100644 --- a/lib/commands/publish.js +++ b/lib/commands/publish.js @@ -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, |