diff options
author | Gar <gar+gh@danger.computer> | 2021-03-24 23:37:05 +0300 |
---|---|---|
committer | Ruy Adorno <ruyadorno@hotmail.com> | 2021-03-25 00:04:26 +0300 |
commit | 200bee74b31a738687446b7b535cac67b1c582fd (patch) | |
tree | fe55030bb7a18d51d3c5960d4ef2e97a0912e8c5 /lib | |
parent | 7b45e9df6102c7bd6e403d1fdc9939581c38f546 (diff) |
fix(config): accept explicit production=false
This allows for overriding the implicit omit value based on if
NODE_ENV=production
PR-URL: https://github.com/npm/cli/pull/2951
Credit: @wraithgar
Close: #2951
Reviewed-by: @ruyadorno
Diffstat (limited to 'lib')
-rw-r--r-- | lib/utils/config/definitions.js | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/lib/utils/config/definitions.js b/lib/utils/config/definitions.js index 3b6d61583..67a830448 100644 --- a/lib/utils/config/definitions.js +++ b/lib/utils/config/definitions.js @@ -29,6 +29,8 @@ const buildOmitList = obj => { const only = obj.only if (/^prod(uction)?$/.test(only) || obj.production) omit.push('dev') + else if (obj.production === false) + include.push('dev') if (/^dev/.test(obj.also)) include.push('dev') @@ -1396,8 +1398,8 @@ define('preid', { }) define('production', { - default: false, - type: Boolean, + default: null, + type: [null, Boolean], deprecated: 'Use `--omit=dev` instead.', description: 'Alias for `--omit=dev`', flatten (key, obj, flatOptions) { |