feat(@angular/cli): add support for custom npmrc paths

According to [the npm config
docs](https://docs.npmjs.com/misc/config#npmrc-files), a user can
specify the path to their `npmrc` files using the environment
variables `NPM_CONFIG_USERCONFIG` and `NPM_CONFIG_GLOBALCONFIG`. When
set, these variables should override the default paths.
This commit is contained in:
Adam Vigneaux 2019-08-27 14:02:50 -04:00 committed by vikerman
parent a35d9084ce
commit 87b01ffd6a

View File

@ -91,8 +91,8 @@ function readOptions(
} }
const defaultConfigLocations = [ const defaultConfigLocations = [
path.join(globalPrefix, 'etc', baseFilename), (!yarn && process.env.NPM_CONFIG_GLOBALCONFIG) || path.join(globalPrefix, 'etc', baseFilename),
path.join(homedir(), dotFilename), (!yarn && process.env.NPM_CONFIG_USERCONFIG) || path.join(homedir(), dotFilename),
]; ];
const projectConfigLocations: string[] = [ const projectConfigLocations: string[] = [