jscc
jscc copied to clipboard
Tiny and powerful preprocessor for conditional comments and replacement of compile-time variables in text files
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...
Adds support for function based macros Examples : ```js assert(jscc("$_HI()", '', { values: { _HI: () => "hi" } }).code === "hi") assert(jscc('$_HI("one", "two", "three")', '', { values: { _HI:...
Thank you for all your hard work. Any chance of a webpack plugin?
This will fix the problem with using #elif as a comment block, like `// #elif _CONDITION */` where the `*/` would crash the parser.