jscc
jscc copied to clipboard
Error: Invalid regular expression
trafficstars
Single line directives capture the comment ending token as part of the expression.
/* #if process.env.TARGET === 'chrome' */
Error: Invalid regular expression: missing / in expression "process.env.TARGET === 'chrome' */"
For languages such as css that don't have single line comments this means that directions must be two lines.
/* #if process.env.TARGET === 'chrome'
*/
This can be fixed by adding a jscc comment, like so:
/*#set _COLOR = "red" //*/
.hi {
/*#if _COLOR === "red" //*/
color: red;
/*#endif //*/
}
This is a better work around but sill sub-optimal. Any reason the pattern can't ignore the comment end tag?