Adds note on global_defs options for UglifyJS.Compressor to README.md.

This commit is contained in:
Jeremy Kahn 2013-09-01 21:06:25 -07:00
parent c28e1a0237
commit c905f48bb6

View File

@ -263,6 +263,19 @@ will evaluate references to them to the value itself and drop unreachable
code as usual. The possible downside of this approach is that the build code as usual. The possible downside of this approach is that the build
will contain the `const` declarations. will contain the `const` declarations.
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
}
});
```
<a name="codegen-options"></a> <a name="codegen-options"></a>
## Beautifier options ## Beautifier options