Skip to content

Commit

Permalink
AMD: Note on AMD best practices
Browse files Browse the repository at this point in the history
Fixes #14687
Closes jquerygh-1478
  • Loading branch information
sheppard authored and dmethvin committed Mar 13, 2014
1 parent 854d242 commit 2585ee5
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
1 change: 1 addition & 0 deletions AUTHORS.txt
Original file line number Diff line number Diff line change
Expand Up @@ -215,3 +215,4 @@ John Paul <[email protected]>
Jakob Stoeck <[email protected]>
Christopher Jones <[email protected]>
Forbes Lindesay <[email protected]>
S. Andrew Sheppard <[email protected]>
6 changes: 6 additions & 0 deletions src/exports/amd.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,12 @@ define([
// derived from file names, and jQuery is normally delivered in a lowercase
// file name. Do this after creating the global so that if an AMD module wants
// to call noConflict to hide this version of jQuery, it will work.

// Note that for maximum portability, libraries that are not jQuery should
// declare themselves as anonymous modules, and avoid setting a global if an
// AMD loader is present. jQuery is a special case. For more information, see
// https://github.com/jrburke/requirejs/wiki/Updating-existing-libraries#wiki-anon

if ( typeof define === "function" && define.amd ) {
define( "jquery", [], function() {
return jQuery;
Expand Down

0 comments on commit 2585ee5

Please sign in to comment.