This repository has been archived by the owner on Apr 20, 2018. It is now read-only.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
In usemin 2.0.0 the configurations targets for all blocks are set to the 'generated' namespace. This makes it difficult to target individual blocks especially when using multiple of one type. Our current project is quite large and I like to keep my main source libs and vendor libs separated and use different uglify options on each js block, 1) to speed up build by not compressing/mangling concatenated vendor libs which come pre minified and 2) specifying preserveComments as many libs like JQuery include License comment banners which are required by copyright law (I know most people just strip these out anyways).
The included patch allows for including an optional configuration target in the html block like so:
Now i rather than everything under the 'generated' target i have 'thirdparty' and 'application' and now I can easily specify custom uglify options for my vendor libs. Simple whitespace removal..
I could even choose to exclude uglify of this js target altogether and only include 'uglify:application' in my build steps.
If you do not specify a target it will use the default 'generated'.
In the future it would be nice to take this a step further and allow for custom flows per target per type as well.
I welcome any feedback.