esbuild minify breaks a regex with a unicode property
Vite 5 uses esbuild for minify in prod. I have const re = /\p{L}+/gu in a validation util. In dev it works. In the minified build it throws: SyntaxError: Invalid regular expression: /\p{L}+/gu: Invalid escape, or sometimes just matches nothing. I added target: 'es2020' to build config and it helped on Chrome but older Safari still complains. What is the right target for unicode property escapes?
4 replies