dividab / tsconfig-paths-webpack-plugin

Load modules according to tsconfig paths in webpack.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

`mainFields` type mismatch with webpack

aaronadamsCA opened this issue · comments

This plugin:

readonly mainFields: string[];

Webpack:

https://github.com/webpack/webpack/blob/2738eebc7880835d88c727d364ad37f3ec557593/types.d.ts#L9718

mainFields?: (string | string[])[];

This causes a type mismatch when forwarding config.resolve.mainFields to this plugin:

image

It might be preferable to directly pass through the types of mainFields (and extensions) directly from webpack. Alternatively, typing them as unknown would prevent type checking altogether, which seems acceptable in this pass-through scenario.