rspack
rspack copied to clipboard
perf: matching module rule using regex is slow
System Info
No response
Details

With lots of modules and lots of rules, this quickly becomes a performance bottleneck.
Reproduce link
No response
Reproduce Steps
No response
regress(current using) is relatively slower than regex. But there are inconsistencies between regex and javascript regex.
We should be able to add a fast path or cache here, because it is mostly running a small regex such as .css$ on a whole directory path.