Hash :e894fc89 Author : Date :
2019-01-23T03:05:58
Inline regex source with gulp (#1537)
Let gulp inline the source of inline regular expressions without flags in minified files.
This means that gulp will replace `/regex/.source` with `'regex'`.
## Motivation
Most IDEs support syntax highlighting and checking of JS inline regular expressions.
This makes them easier to work with and less error-prone than having a string hold the expression. Inline regexes are also usually shorter than their string counterparts because
you don't have to escape backslashes. There are also some linters (e.g. ESLint) for JS
regular expression which (of course) won't work on strings.
This lets you enjoy the advantages of inline regexes without worrying about the additional
overhead of compiling another regular expression on the client side.