Thanks to visit codestin.com
Credit goes to github.com

Skip to content

The type of Rules breaks #564

@licg9999

Description

@licg9999

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions