Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error: Invalid regular expression #12

Open
RedHatter opened this issue Jan 1, 2021 · 2 comments
Open

Error: Invalid regular expression #12

RedHatter opened this issue Jan 1, 2021 · 2 comments

Comments

@RedHatter
Copy link

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'
*/
@BobVarioa
Copy link

BobVarioa commented May 4, 2021

This can be fixed by adding a jscc comment, like so:

/*#set _COLOR = "red" //*/
.hi {
    /*#if _COLOR === "red" //*/
    color: red; 
    /*#endif //*/
}

@RedHatter
Copy link
Author

This is a better work around but sill sub-optimal. Any reason the pattern can't ignore the comment end tag?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants