diff options
author | Sebastien Daniel <info@sebastiendaniel.ca> | 2016-03-04 07:32:24 -0500 |
---|---|---|
committer | Richard van Velzen <rvanvelzen@experty.com> | 2016-03-27 19:42:52 +0200 |
commit | 9bcf702a6e12ab35fda9ca35042ae3dc7c449891 (patch) | |
tree | 8692041c5bbb1b91eb3223d4666f4c935e28af4f | |
parent | f68de86a174530a1e796eabbf872633a01485900 (diff) | |
download | tracifyjs-9bcf702a6e12ab35fda9ca35042ae3dc7c449891.tar.gz tracifyjs-9bcf702a6e12ab35fda9ca35042ae3dc7c449891.zip |
added documentation on conditional compilation using API
-rw-r--r-- | README.md | 16 |
1 files changed, 16 insertions, 0 deletions
@@ -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`. <a name="codegen-options"></a> + +#### 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 |