diff --git a/README.md b/README.md index d15f114c..04515755 100644 --- a/README.md +++ b/README.md @@ -501,6 +501,19 @@ code as usual. The build will contain the `const` declarations if you use them. If you are targeting < ES6 environments which does not support `const`, using `var` with `reduce_vars` (enabled by default) should suffice. +You can also define variables via the API (if UglifyJS is being called +from a JavaScript file, for instance). Just supply the values to +`UglifyJS.Compressor`: + +```javascript +var compressor = UglifyJS.Compressor({ + global_defs: { + DEBUG: false, + PRODUCTION: true + } +}); +``` + #### Conditional compilation, API