fix: onlyBuiltDependencies should work (#4377)

This commit is contained in:
Zoltan Kochan
2022-02-23 01:54:55 +02:00
parent 4dca63daa6
commit 4e3b99ae0e
3 changed files with 9 additions and 3 deletions

View File

@@ -0,0 +1,7 @@
---
"@pnpm/core": patch
"@pnpm/plugin-commands-installation": patch
"pnpm": patch
---
`onlyBuiltDependencies` should work.

View File

@@ -49,7 +49,7 @@ export interface StrictInstallOptions {
rawConfig: object
verifyStoreIntegrity: boolean
engineStrict: boolean
neverBuiltDependencies: string[]
neverBuiltDependencies?: string[]
onlyBuiltDependencies?: string[]
nodeExecPath?: string
nodeLinker?: 'isolated' | 'hoisted' | 'pnp'
@@ -133,7 +133,6 @@ const defaults = async (opts: InstallOptions) => {
},
lockfileDir: opts.lockfileDir ?? opts.dir ?? process.cwd(),
lockfileOnly: false,
neverBuiltDependencies: [] as string[],
nodeVersion: process.version,
nodeLinker: 'isolated',
overrides: {},

View File

@@ -15,7 +15,7 @@ export default function getOptionsFromRootManifest (manifest: ProjectManifest):
// but we really replace the version specs to any other version spec, not only to exact versions,
// so we cannot call it resolutions
const overrides = manifest.pnpm?.overrides ?? manifest.resolutions
const neverBuiltDependencies = manifest.pnpm?.neverBuiltDependencies ?? []
const neverBuiltDependencies = manifest.pnpm?.neverBuiltDependencies
const onlyBuiltDependencies = manifest.pnpm?.onlyBuiltDependencies
const packageExtensions = manifest.pnpm?.packageExtensions
const peerDependencyRules = manifest.pnpm?.peerDependencyRules