[Pkg-javascript-commits] [uglifyjs] 128/190: added documentation on conditional compilation using API

Antonio Terceiro terceiro at moszumanska.debian.org
Sun Aug 7 23:17:19 UTC 2016


This is an automated email from the git hooks/post-receive script.

terceiro pushed a commit to annotated tag upstream/2.7.0
in repository uglifyjs.

commit 9bcf702a6e12ab35fda9ca35042ae3dc7c449891
Author: Sebastien Daniel <info at sebastiendaniel.ca>
Date:   Fri Mar 4 07:32:24 2016 -0500

    added documentation on conditional compilation using API
---
 README.md | 16 ++++++++++++++++
 1 file changed, 16 insertions(+)

diff --git a/README.md b/README.md
index 9255901..9118d66 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`.
 
 <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

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-javascript/uglifyjs.git



More information about the Pkg-javascript-commits mailing list