Correct mainFields type
aaronadamsCA opened this issue · comments
The type of mainFields
is set to string[]
in a few places, including the signature of createMatchPathAsync
.
The correct type is (string | string[])[]
:
https://github.com/webpack/webpack/blob/9fcaa243573005d6fdece9a3f8d89a0e8b399613/types.d.ts#L9767
This test case confirms the type is correct:
For type safety, it would be great if this package were compatible with the Webpack type of mainFields
, foregoing the need for type assertions. Thanks!
Here's the reason this syntax exists:
webpack/webpack#7204 (comment)
It's probably not very commonly used, but it'd still be good to be compatible with Webpack here.