feat: setting only-built-dependencies through .npmrc

This commit is contained in:
Zoltan Kochan committed 2022-07-29 13:21:41 +03:00
1 parent cac34ad690
commit 99019e0716
4 files changed
+13 -2

No files matched your search

+6
View File
@@ -0,0 +1,6 @@
---
"@pnpm/config": minor
"@pnpm/plugin-commands-installation": minor
---
Allow to set `only-built-dependencies[]` through `.npmrc`.
+1
View File
@@ -148,6 +148,7 @@ export interface Config {
embedReadme?: boolean
gitShallowHosts?: string[]
legacyDirFiltering?: boolean
onlyBuiltDependencies?: string[]
registries: Registries
ignoreWorkspaceRootCheck: boolean
+1
View File
@@ -80,6 +80,7 @@ export const types = Object.assign({
noproxy: String,
'npm-path': String,
offline: Boolean,
'only-built-dependencies': [String],
'package-import-method': ['auto', 'hardlink', 'clone', 'copy'],
pnpmfile: String,
'prefer-frozen-lockfile': Boolean,
@@ -24,13 +24,16 @@ export default function getOptionsFromRootManifest (manifest: ProjectManifest):
const peerDependencyRules = manifest.pnpm?.peerDependencyRules
const allowedDeprecatedVersions = manifest.pnpm?.allowedDeprecatedVersions
const patchedDependencies = manifest.pnpm?.patchedDependencies
return {
const settings = {
allowedDeprecatedVersions,
overrides,
neverBuiltDependencies,
onlyBuiltDependencies,
packageExtensions,
peerDependencyRules,
patchedDependencies,
}
if (onlyBuiltDependencies) {
settings['onlyBuiltDependencies'] = onlyBuiltDependencies
}
return settings
}