minify module properly? #4569
Replies: 1 comment
-
Posted at 2015-04-05 by @gfwilliams Yep, you basically wrap it in Posted at 2015-04-05 by the1laz Okay. I've tried that and it won't minimise the "C" private constants. Do you just use simple optimisation? Posted at 2015-04-05 by DrAzzy I was never able to make it minify constants either. Posted at 2015-04-05 by @gfwilliams Hmm... sure you defined C with
Just done and it compiles to:
Posted at 2015-04-06 by the1laz I just tried copying the same thing in as I did yesterday and it worked this time. :S I'm sorry, I must be going crazy... Posted at 2015-04-12 by the1laz Just for anyone else having trouble with minifying, errors in your code can affect it. I think that's what was messing me up, I had a couple of things that weren't causing error messages or being picked up by JSHint but they were stopping minification. Posted at 2015-04-12 by @gfwilliams They were stopping the Web IDE from working but you weren't being told? Can you post up a small example? If the online minification fails then it should report error messages. Perhaps the new offline minification doesn't report errors correctly? Posted at 2015-04-13 by the1laz My code was minifying, just not completely. It's not a problem with the IDE, or even the compiler I suppose, just a quirk in the process. Private constants was the main thing that wasn't minifying. One of the reasons was that in one of my functions I was referring to a value not listed in the array, which wouldn't normally be a problem until that function is called. It looks like closure compiler just skipped C and moved on without an error. Posted at 2015-04-13 by @gfwilliams Ahh, interesting. Thanks for letting me know! Yes, I suppose it's still valid JS so it can't really complain about it :) I wonder if there's a 'pedantic' mode where it'll tell you all this stuff - it could be really useful. Posted at 2015-04-15 by the1laz Looks like you get a warning if you set warning_level to VERBOSE. I think I should run all my code through this just to find the errors that nothing else picks up! |
Beta Was this translation helpful? Give feedback.
-
Posted at 2015-04-05 by the1laz
I just tried to use the Closure Compiler directly through the website and using the minify.js script. Neither way would remove the constants. C's contents stays the same. Is there another method that's used for minifying files for the website?
Beta Was this translation helpful? Give feedback.
All reactions