From: Sebastien Daniel Date: Fri, 4 Mar 2016 12:32:24 +0000 (-0500) Subject: added documentation on conditional compilation using API X-Git-Url: https://git.ndcode.org/public/gitweb.cgi?a=commitdiff_plain;h=9bcf702a6e12ab35fda9ca35042ae3dc7c449891;p=UglifyJS.git added documentation on conditional compilation using API --- diff --git a/README.md b/README.md index 92559019..9118d663 100644 --- a/README.md +++ b/README.md @@ -410,6 +410,22 @@ code as usual. The build will contain the `const` declarations if you use them. If you are targeting < ES6 environments, use `/** @const */ var`. + +#### Conditional compilation, API +You can also use conditional compilation via the programmatic API. With the difference that the +property name is `global_defs` and is a compressor property: + +```js +uglifyJS.minify([ "input.js"], { + compress: { + dead_code: true, + global_defs: { + DEBUG: false + } + } +}); +``` + ## Beautifier options The code generator tries to output shortest code possible by default. In