From 892cd6132d679c558827e6b7e7a00b838fccafe6 Mon Sep 17 00:00:00 2001 From: Luke Channings Date: Mon, 25 Aug 2014 16:00:02 +0100 Subject: [PATCH] Update requirejs config to shim jquery as a dependency of velocity. --- amd-tests/README.md | 2 +- amd-tests/built-withjquery.html | 3 +++ amd-tests/withjquery.html | 3 +++ 3 files changed, 7 insertions(+), 1 deletion(-) diff --git a/amd-tests/README.md b/amd-tests/README.md index fee471a9..ef58678d 100644 --- a/amd-tests/README.md +++ b/amd-tests/README.md @@ -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 `$(<>).velocity(<>)`. diff --git a/amd-tests/built-withjquery.html b/amd-tests/built-withjquery.html index 33a3bd8e..a2955c3d 100644 --- a/amd-tests/built-withjquery.html +++ b/amd-tests/built-withjquery.html @@ -20,6 +20,9 @@ paths: { jquery: 'vendor/jquery-2.1.1.min', velocity: '../../jquery.velocity' + }, + shim: { + velocity: ['jquery'] } }) diff --git a/amd-tests/withjquery.html b/amd-tests/withjquery.html index dc2f2cb9..fa13dd59 100644 --- a/amd-tests/withjquery.html +++ b/amd-tests/withjquery.html @@ -20,6 +20,9 @@ paths: { jquery: 'vendor/jquery-2.1.1.min', velocity: '../../jquery.velocity' + }, + shim: { + velocity: ['jquery'] } })