You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When passing array of RegExp as test property in CompressionPlugin constructor, TypeScript will be unable to compile when running Webpack script with TypeScript:
error TS2322: Type 'RegExp[]' is not assignable to type 'Rule'
Expected Behavior
Expect no TypeScript errors when running Webpack script with TypeScript.
The text was updated successfully, but these errors were encountered:
Skarbo
changed the title
Type definition BasePluginOptions property test should use Rules, not Rule
Type definition BasePluginOptions property test should use Rules, not RuleFeb 27, 2024
Bug report
Type definition
BasePluginOptions
has the wrong type definitionRule
for propertiestest
,include
andexclude
.According to the documentation
the properties should be defined as
Rules
:Actual Behavior
When passing array of RegExp as
test
property inCompressionPlugin
constructor, TypeScript will be unable to compile when running Webpack script with TypeScript:error TS2322: Type 'RegExp[]' is not assignable to type 'Rule'
Expected Behavior
Expect no TypeScript errors when running Webpack script with TypeScript.
How Do We Reproduce?
Please paste the results of
npx webpack-cli info
here, and mention other relevant informationThe text was updated successfully, but these errors were encountered: