For example, setting MYCONST = true would lead to the transformation of
if (MYCONST) {
console.log('MYCONST IS TRUE!'); // print important message
}
to
if (true) {
console.log('MYCONST IS TRUE!'); // print important message
}
This tool ideally has a fast node.js accessible API.
google’s closure compiler does, among other things, inlining of constants when annotated as such, leaving string content untouched but I am not sure if it’s a viable option for you.