mirror of
https://github.com/angular/angular-cli.git
synced 2025-05-17 19:13:34 +08:00
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:
parent
a35d9084ce
commit
87b01ffd6a
@ -91,8 +91,8 @@ function readOptions(
|
||||
}
|
||||
|
||||
const defaultConfigLocations = [
|
||||
path.join(globalPrefix, 'etc', baseFilename),
|
||||
path.join(homedir(), dotFilename),
|
||||
(!yarn && process.env.NPM_CONFIG_GLOBALCONFIG) || path.join(globalPrefix, 'etc', baseFilename),
|
||||
(!yarn && process.env.NPM_CONFIG_USERCONFIG) || path.join(homedir(), dotFilename),
|
||||
];
|
||||
|
||||
const projectConfigLocations: string[] = [
|
||||
|
Loading…
x
Reference in New Issue
Block a user