expose #options attribute#26
Merged
jashkenas merged 1 commit intodocumentcloud:masterfrom Jan 24, 2013
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Motivation: when using Jammit with multiple packages, it is useful to vary options given to the jar based on an individual package.
For example, to generate source maps the closure compiler takes an option
--create_source_map, with the path for the output source map. If I have 3 packages in my Jammit assets.yml, the last one to be packaged will overwrite the source map file (as the 2nd one will have already done to the 1st).(actually getting Jammit to do this correctly will require some changes in that project; a pull request there is forthcoming)
This patch allows the options hash to be changed for each run, without creating a new
Closure::Compilerobject. Creating a new object is feasible too, although a bit less clean imo.