Skip to content

Commit

Permalink
Update requirejs config to shim jquery as a dependency of velocity.
Browse files Browse the repository at this point in the history
  • Loading branch information
amazeplc committed Aug 25, 2014
1 parent 49f0ae9 commit 892cd61
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 1 deletion.
2 changes: 1 addition & 1 deletion amd-tests/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ Velocity presently has two builds, `jquery.velocity.js` and `velocity.js`.

Both velocity builds can be used with requirejs and r.js simply by including it in your project and requiring it.

If you're using `jquery.velocity.js`, ensure that jQuery is also in your project (and that it is required before Velocity).
If you're using `jquery.velocity.js`, make sure jQuery is shimmed as a dependency in your requirejs configuration.

As is usual for jQuery plugins, `jquery.velocity.js` extends jQuery.fn, which means that you only have to require it once if you choose to use it like `$(<<selector>>).velocity(<<velocity-options>>)`.

Expand Down
3 changes: 3 additions & 0 deletions amd-tests/built-withjquery.html
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,9 @@
paths: {
jquery: 'vendor/jquery-2.1.1.min',
velocity: '../../jquery.velocity'
},
shim: {
velocity: ['jquery']
}
})

Expand Down
3 changes: 3 additions & 0 deletions amd-tests/withjquery.html
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,9 @@
paths: {
jquery: 'vendor/jquery-2.1.1.min',
velocity: '../../jquery.velocity'
},
shim: {
velocity: ['jquery']
}
})

Expand Down

0 comments on commit 892cd61

Please sign in to comment.