Skip to content

Commit

Permalink
Fix typing of mainFields option (#106)
Browse files Browse the repository at this point in the history
  • Loading branch information
chenjiahan authored Nov 13, 2024
1 parent 84eeecd commit 8253348
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ An array of the extensions that will be tried during resolve. Ideally this would

This allows you to override the `baseUrl` found in tsconfig.json. The baseUrl specifies from which directory `paths` should be resolved. So this option enabled you to resolve from another directory than the one where tsconfig.json is located. This can be useful if you want to use webpack with `tsc --watch` instead of a typescript loader. If this option is `undefined` then the `baseUrl` from tsconfig.json will be used.

#### mainFields _(string[]) (default=["main"])_
#### mainFields _((string | string[])[]) (default=["main"])_

An array of the field names that should be considered when resolving packages. Ideally this would be the same as the mainFields from the webpack config but it seems resolver plug-ins does not have access to this infomration so you need to specify it again for the plugin.

Expand Down
2 changes: 1 addition & 1 deletion src/options.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ export interface Options {
readonly logInfoToStdOut: boolean;
readonly context: string | undefined;
readonly colors: boolean;
readonly mainFields: string[];
readonly mainFields: (string | string[])[];
readonly references: string[] | undefined;
}

Expand Down

0 comments on commit 8253348

Please sign in to comment.