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.
Our team has gotten excellent mileage out of this little library, but have recently switched to browserify as a build tool. This little PR adds a UMD wrapper around the FitVids factory, such that it can be consumed in three different ways, all of which still allow your choice between jQuery or Zepto.
For
node
or CommonJS environments (such as browserify), it exports the factory itself, so that the choice of DOM library can be wired up manually:For AMD environments (like require.js), you can just
require
FitVids and then go about your business, since it will wrap itself around whichever DOM library you shimmed in as'jquery'
:For those who like to live in the global namespace, that's cool too. The UMD wrapper will recognize that and look for
window.jQuery
orwindow.Zepto
as before.I ran the
test.html
file, and everything performs as it originally did. This PR should also get you very close to publishing on npm (short of actually runningnpm publish .
). That would be super dreamy! 😄