Is there a way to tell Google Closure Compiler to *NOT* inline my local functions?

前端 未结 2 1444
无人及你
无人及你 2021-01-17 03:35

Here\'s what I\'m looking for:

  • I want to use the wonderful features of SIMPLE mode minification while disabling just one specific feat
2条回答
  •  感情败类
    2021-01-17 04:26

    Use the function constructor

    var fnc = new Function("param1", "param2", "alert(param1+param2);");
    

    Closure will leave the String literals alone.

    See https://developer.mozilla.org/de/docs/Web/JavaScript/Reference/Global_Objects/Function

提交回复
热议问题