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 gh-1478
(cherry picked from commit 19220c0f29fa60d80a2beb76f048ffc8b972ba35)

Conflicts:
	AUTHORS.txt
  • Loading branch information
sheppard authored and dmethvin committed Mar 13, 2014
1 parent 85ba301 commit 6d76198
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
1 change: 1 addition & 0 deletions AUTHORS.txt
Expand Up @@ -206,3 +206,4 @@ Jakob Stoeck <jakob@pokermania.de>
cjqed <christopherjonesqed@gmail.com>
Forbes Lindesay <forbes@lindesay.co.uk>
John Paul <john@johnkpaul.com>
S. Andrew Sheppard <andrew@wq.io>
6 changes: 6 additions & 0 deletions src/exports/amd.js
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

This comment has been minimized.

Copy link
@jdalton

jdalton Mar 24, 2014

Member

👍

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

0 comments on commit 6d76198

Please sign in to comment.