added documentation on conditional compilation using API
This commit is contained in:
committed by
Richard van Velzen
parent
f68de86a17
commit
9bcf702a6e
16
README.md
16
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`.
|
them. If you are targeting < ES6 environments, use `/** @const */ var`.
|
||||||
|
|
||||||
<a name="codegen-options"></a>
|
<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
|
## Beautifier options
|
||||||
|
|
||||||
The code generator tries to output shortest code possible by default. In
|
The code generator tries to output shortest code possible by default. In
|
||||||
|
|||||||
Reference in New Issue
Block a user