Skip to content
This repository has been archived by the owner on Nov 23, 2018. It is now read-only.

Concatenation after minifying and ADVANCED_OPTIMIZATIONS #162

Open
bungle opened this issue May 23, 2013 · 5 comments
Open

Concatenation after minifying and ADVANCED_OPTIMIZATIONS #162

bungle opened this issue May 23, 2013 · 5 comments

Comments

@bungle
Copy link

bungle commented May 23, 2013

If I understand correctly, this ANT Build task does js-minification in this order:

  1. minifies every js file
  2. concatenates minified js files

This is really problematic if you want to use Closure Compiler's ADVANCED_OPTIMIZATIONS. The order should be reversed:

  1. concatenates js files
  2. minifies the concatenated file

Or have I understood something wrong?

@roblarsen
Copy link
Member

You're not missing anything. We minify everything first in order to allow people to minify files that will not be concatenated. it would be easy to swap the order, but it would be hairy to do it for the larger project, I think. I'd have to look at it.

@bungle
Copy link
Author

bungle commented May 23, 2013

I think you got it, but in other words the problem is that, say I have this:

<!-- //-beg- concat_js -->
Lots of JS-files here (that are calling each other,
but Closure Compiler does not know it because
everything is minified separately).
<!-- //-end- concat_js -->

It is really important to first concate everything between those tags, and after that minify. Otherwise ADVANCED_OPTIMIZATIONS is useless. This is the only place where you should concatenate first, others are fine as is.

@roblarsen
Copy link
Member

Yes, I see your problem clearly. I was just pointing out why the script is the way it is. I don't have an answer off the top of my head as to how I would be able to reconfigure it in order to solve your problem while retaining the existing ease of use. I'd be happy to be able to solve your problem as long as I don't add any further complexity to the set up.

@bungle
Copy link
Author

bungle commented May 23, 2013

I see how this can add a little bit complexity, i.e. should we then also have separate options for minifying process (i.e. ADVANCED_OPTIOMIZATIONS for concatenated js-file, and SIMPLE_OPTIMIZATIONS for others).

@roblarsen
Copy link
Member

I wasn't even thinking about that, but yes, that would open up further complexity. That would be a nice feature to add, actually.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants