Stay debugged
npm install babel-plugin-debug-mode --save-dev
You define code snippet inside block statement with "debug" directive like this
function ChangeMode(pMode){
{"debug";console.log("Mode changed to " + pMode);}
//do something
}
Multiline implementation
theInput.onkeydown = (pEvent)=>{
{
"debug";
console.log(pEvent.key);
if(pEvent.key == "Enter")
pEvent.preventDefault();
}
//rest stuff
}
Inside Class Method definition
class Delegate
{
...
WriteDebugInfo(pWho, pMethod){
"debug";
console.debug(`%c\t\u27A5${pWho.constructor.name}(${pMethod})`, "color:ForestGreen;font-size:1em;");
}
}
Turn debug off if you want remove blocks, which have "debug" directive
{
"plugins": [["debug-mode", "off"]]
}
or like this
{
"plugins": ["debug-mode"]
}
Turn debug on - blocks will retain untouched
{
"plugins": [["debug-mode", "on"]]
}
Any feedback is highly appreciated (https://github.com/TilliWilli5 , tilliwilli@gmail.com)
Benice guys;)