--closure 1 doesn't minify

33 views
Skip to first unread message

Soeren Balko

unread,
Dec 21, 2014, 12:16:11 AM12/21/14
to emscripte...@googlegroups.com
Hi,

I have tried to rebuild my project with the new native optimizer on incoming (no problems) and also tried running closure (--closure 1) during the build (in conjunction with some additions to the generated Javascript using --js-transform, --pre-js, --post-js). However I noticed that while the generated code looks different from when I do not use "--closure 1", it is not minified. I think I made sure that there is enough heap space for Java - at the least the compiler completes without an error, so I must assume that closure has, indeed, finished. 

Any ideas?

Soeren

Alon Zakai

unread,
Dec 21, 2014, 12:19:01 AM12/21/14
to emscripte...@googlegroups.com
See emcc --help, you are probably looking for --closure 2. But see warnings in the documentation there.

- Alon


--
You received this message because you are subscribed to the Google Groups "emscripten-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to emscripten-disc...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Sören Balko

unread,
Dec 21, 2014, 12:23:36 AM12/21/14
to emscripte...@googlegroups.com
Actually, I don’t: as I understand —closure 2 changes the asm.js code, which is not what I want. I really am only interested in running closure on the wrapper code. With the new optimiser backend (but without —closure 1), the code is semi-minified (AFAICS, whitespaces/newlines are removed). Adding —closure 1 seems to re-insert whitespace and newlines, which is weird. It does leave an effect other than that, as the code looks very different.

Soeren

You received this message because you are subscribed to a topic in the Google Groups "emscripten-discuss" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/emscripten-discuss/1JqFyMIw-Ac/unsubscribe.
To unsubscribe from this group and all its topics, send an email to emscripten-disc...@googlegroups.com.

Alon Zakai

unread,
Dec 21, 2014, 12:37:25 AM12/21/14
to emscripte...@googlegroups.com
Ah, sorry, now I understand you.

Yes, good point, this turns out to be a bug in the native optimizer, it wasn't minifying whitespace. Fixed on incoming now, please verify.

- Alon

Soeren Balko

unread,
Dec 21, 2014, 1:05:34 AM12/21/14
to emscripte...@googlegroups.com
Verified - works now! Thanks for the quick help!


On Sunday, December 21, 2014 3:37:25 PM UTC+10, Alon Zakai wrote:
Ah, sorry, now I understand you.

Yes, good point, this turns out to be a bug in the native optimizer, it wasn't minifying whitespace. Fixed on incoming now, please verify.

- Alon

On Sat, Dec 20, 2014 at 9:23 PM, Sören Balko <soeren...@gmail.com> wrote:
Actually, I don’t: as I understand —closure 2 changes the asm.js code, which is not what I want. I really am only interested in running closure on the wrapper code. With the new optimiser backend (but without —closure 1), the code is semi-minified (AFAICS, whitespaces/newlines are removed). Adding —closure 1 seems to re-insert whitespace and newlines, which is weird. It does leave an effect other than that, as the code looks very different.

Soeren

On 21 Dec 2014, at 15:19, Alon Zakai <alon...@gmail.com> wrote:

See emcc --help, you are probably looking for --closure 2. But see warnings in the documentation there.

- Alon

On Sat, Dec 20, 2014 at 9:16 PM, Soeren Balko <soe...@zfaas.com> wrote:
Hi,

I have tried to rebuild my project with the new native optimizer on incoming (no problems) and also tried running closure (--closure 1) during the build (in conjunction with some additions to the generated Javascript using --js-transform, --pre-js, --post-js). However I noticed that while the generated code looks different from when I do not use "--closure 1", it is not minified. I think I made sure that there is enough heap space for Java - at the least the compiler completes without an error, so I must assume that closure has, indeed, finished. 

Any ideas?

Soeren

--
You received this message because you are subscribed to the Google Groups "emscripten-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to emscripten-discuss+unsub...@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.


--
You received this message because you are subscribed to a topic in the Google Groups "emscripten-discuss" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/emscripten-discuss/1JqFyMIw-Ac/unsubscribe.
To unsubscribe from this group and all its topics, send an email to emscripten-discuss+unsub...@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "emscripten-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to emscripten-discuss+unsub...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages