Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

The type of Rules breaks #564

Closed
licg9999 opened this issue May 17, 2023 · 3 comments · Fixed by #565
Closed

The type of Rules breaks #564

licg9999 opened this issue May 17, 2023 · 3 comments · Fixed by #565

Comments

@licg9999
Copy link

Bug report

Hi, the type of Rules seems to break since the PR https://github.com/webpack-contrib/terser-webpack-plugin/pull/561/files#diff-093ad82a25aee498b11febf1cdcb6546e4d223ffcb49ed69cc275ac27ce0ccceR138 cc: @alexander-akait

The type of Rules was:

type Rule = RegExp | string;
type Rules = Rule[] | Rule; // => (RegExp | string)[] | RegExp | string

But now, it's:

type Rules = string | string[] | RegExp | RegExp[];

This breaking change makes it not valid any more to declare an array containing both strings and RegExp's to options.test/include/exclude, which looks unexpected. Would you take a look? Thanks.

Actual Behavior

Expected Behavior

How Do We Reproduce?

Please paste the results of npx webpack-cli info here, and mention other relevant information

@alexander-akait
Copy link
Member

I see... Sounds like we have a bug in webpack with types

@alexander-akait
Copy link
Member

Fix in webpack webpack/webpack#17207, when it will be merged I will fix it here, I hope it will be today

@alexander-akait alexander-akait mentioned this issue May 17, 2023
6 tasks
@licg9999
Copy link
Author

Thank you for the quick turn around. No hurry, just take your time.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants