rc-config-loader 2.0.4 → 2.0.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +5 -3
- package/lib/rc-config-loader.d.ts +5 -1
- package/package.json +1 -1
- package/src/rc-config-loader.d.ts +5 -1
package/README.md
CHANGED
|
@@ -40,11 +40,13 @@ Install with [npm](https://www.npmjs.com/):
|
|
|
40
40
|
```ts
|
|
41
41
|
export interface rcConfigLoaderOption {
|
|
42
42
|
// does look for `package.json`
|
|
43
|
-
packageJSON?: boolean
|
|
43
|
+
packageJSON?: boolean | {
|
|
44
|
+
fieldName: string;
|
|
45
|
+
};
|
|
44
46
|
// if config file name is not same with packageName, set the name
|
|
45
47
|
configFileName?: string;
|
|
46
48
|
// treat default(no ext file) as some extension
|
|
47
|
-
defaultExtension?: string | string[]
|
|
49
|
+
defaultExtension?: string | string[];
|
|
48
50
|
// where start to load
|
|
49
51
|
cwd?: string;
|
|
50
52
|
}
|
|
@@ -107,7 +109,7 @@ console.log(rcfile("bar", {
|
|
|
107
109
|
defaultExtension: [".json", ".yml", ".js"]
|
|
108
110
|
}));
|
|
109
111
|
|
|
110
|
-
// try to load as .
|
|
112
|
+
// try to load as .json, but it is not json
|
|
111
113
|
// throw Error
|
|
112
114
|
try {
|
|
113
115
|
rcfile("unknown", {
|
|
@@ -1,6 +1,10 @@
|
|
|
1
1
|
export interface rcConfigLoaderOption {
|
|
2
2
|
// does look for `package.json`
|
|
3
|
-
packageJSON?:
|
|
3
|
+
packageJSON?:
|
|
4
|
+
| boolean
|
|
5
|
+
| {
|
|
6
|
+
fieldName: string;
|
|
7
|
+
};
|
|
4
8
|
// if config file name is not same with packageName, set the name
|
|
5
9
|
configFileName?: string;
|
|
6
10
|
// treat default(no ext file) as some extension
|
package/package.json
CHANGED
|
@@ -1,6 +1,10 @@
|
|
|
1
1
|
export interface rcConfigLoaderOption {
|
|
2
2
|
// does look for `package.json`
|
|
3
|
-
packageJSON?:
|
|
3
|
+
packageJSON?:
|
|
4
|
+
| boolean
|
|
5
|
+
| {
|
|
6
|
+
fieldName: string;
|
|
7
|
+
};
|
|
4
8
|
// if config file name is not same with packageName, set the name
|
|
5
9
|
configFileName?: string;
|
|
6
10
|
// treat default(no ext file) as some extension
|