“makes” preprocess doesn’t do full syntax analysis on any structured files (js/html/…), it only blindly matches preprocess directive (
@eval). That’s why following example works:
var name = "/* @echo name */";
Preprocess successfully picked up
“makes” preprocess knows nothing more than its more syntax.
In rarely cases, you may want “makes” preprocess to ignore some directive literal. For example you want to write a file to the final project for
gulp-preprocess (the gulp wrapper of preprocess) to use.
Here we use a trick to use
/* @echo na */ to break any
@eval directive. Because
na is not defined in
/* @echo na */ will yield to empty string.
For example in https://github.com/dumberjs/new/blob/master/aurelia/src/main.ext
// @/* @echo na */if isProduction aurelia.use.developmentLogging('warn'); // @/* @echo na */endif
// @if isProduction aurelia.use.developmentLogging('warn'); // @endif
@endif directives were reserved.
Sometime your one line condition will trigger annoying syntax error in your editor. Like this one:
var target = /* @if no-ie */"es6"/* @endif *//* @if ie */"es3"/* @endif */;
While this is still a correct skeleton file, the cosmetic syntax error in editor is annoying. To help you avoid this small setback, you can use
** instead of
*/ to close an if clause. This is a feature inherited from original preprocess.
var target = /* @if no-ie **"es6"/* @endif *//* @if ie */"es3"/* @endif */;