Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 1 addition & 4 deletions docs/emcc.txt
Original file line number Diff line number Diff line change
Expand Up @@ -252,7 +252,7 @@ Options that are modified or new in *emcc* are listed below:
"--closure 0|1|2"
[link] Runs the *Closure Compiler*. Possible values are:

* "0": No closure compiler (default in "-O2" and below).
* "0": No closure compiler (default).

* "1": Run closure compiler. This greatly reduces the size of
the support JavaScript code (everything but the WebAssembly or
Expand All @@ -277,9 +277,6 @@ Options that are modified or new in *emcc* are listed below:
before the closure-compiled code runs, because then it will
reuse that variable.

* Closure is only run if JavaScript opts are being done ("-O2" or
above).

"--closure-args=<args>"
[link] Pass arguments to the *Closure compiler*. This is an
alternative to "EMCC_CLOSURE_ARGS".
Expand Down
3 changes: 1 addition & 2 deletions site/source/docs/tools_reference/emcc.rst
Original file line number Diff line number Diff line change
Expand Up @@ -262,15 +262,14 @@ Options that are modified or new in *emcc* are listed below:
[link]
Runs the :term:`Closure Compiler`. Possible values are:

- ``0``: No closure compiler (default in ``-O2`` and below).
- ``0``: No closure compiler (default).
- ``1``: Run closure compiler. This greatly reduces the size of the support JavaScript code (everything but the WebAssembly or asm.js). Note that this increases compile time significantly.
- ``2``: Run closure compiler on *all* the emitted code, even on **asm.js** output in **asm.js** mode. This can further reduce code size, but does prevent a significant amount of **asm.js** optimizations, so it is not recommended unless you want to reduce code size at all costs.

.. note::

- Consider using ``-sMODULARIZE`` when using closure, as it minifies globals to names that might conflict with others in the global scope. ``MODULARIZE`` puts all the output into a function (see ``src/settings.js``).
- Closure will minify the name of `Module` itself, by default! Using ``MODULARIZE`` will solve that as well. Another solution is to make sure a global variable called `Module` already exists before the closure-compiled code runs, because then it will reuse that variable.
- Closure is only run if JavaScript opts are being done (``-O2`` or above).

``--closure-args=<args>``
[link]
Expand Down
Loading