spamscanner/url-regex-safe

re2 breaks builds

Closed this issue · 2 comments

This originates from uhop/node-re2#92, affecting builds via webpack and esbuild, browser or TypeScript for servers all alike.

Option 1

Change re2 into a peer dependency, such that users can choose to install re2 or not, depending on their situation.

Option 2

If the existence of url-regex-safe over url-regex means re2 must be kept in dependencies, at least change the actual code to allow fallback to plain RegExp, so webpack/esbuild users can mark re2 as external in build time until the issue above is fixed.

v2.1.0 released which resolves this issue, thanks to @vicary for the PR

https://github.com/niftylettuce/url-regex-safe/releases/tag/v2.1.0