Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

Register jQuery as a CommonjS async module #25

Closed
wants to merge 5 commits into from

2 participants

@jrburke

This patch goes with this ticket: http://dev.jquery.com/ticket/7102

jrburke added some commits
@jrburke jrburke Register as a CommonJS async module if in that kind of environment 93dc7a7
@jrburke jrburke Merge branch 'master' of http://github.com/jquery/jquery d3dd0d5
@jrburke jrburke Update to define() to match Async Module API. 9223483
@jrburke jrburke Merge branch 'master' of http://github.com/jquery/jquery 1084c53
@jrburke jrburke Defining an explicit module called 'jquery', since otherwise, using a…
…nonymous modules in an optimization script that does not know about modules, it can break code that does know about anonymous modules, if both types of scripts are mixed together. 'jquery' was used instead of 'jQuery' because commonjs module identifiers map to file names, and normally the file name for jquery is in lower case.
422b6d3
@csnover

Committed.

This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Sep 30, 2010
  1. @jrburke
Commits on Oct 15, 2010
  1. @jrburke
  2. @jrburke
Commits on Dec 2, 2010
  1. @jrburke
  2. @jrburke

    Defining an explicit module called 'jquery', since otherwise, using a…

    jrburke authored
    …nonymous modules in an optimization script that does not know about modules, it can break code that does know about anonymous modules, if both types of scripts are mixed together. 'jquery' was used instead of 'jQuery' because commonjs module identifiers map to file names, and normally the file name for jquery is in lower case.
This page is out of date. Refresh to see the latest.
Showing with 5 additions and 0 deletions.
  1. +5 −0 src/core.js
View
5 src/core.js
@@ -885,6 +885,11 @@ function doScrollCheck() {
jQuery.ready();
}
+// Expose jQuery as an Asynchronous Module
+if ( typeof define !== "undefined" ) {
+ define( "jquery", [], function () { return jQuery; } );
+}
+
// Expose jQuery to the global object
return (window.jQuery = window.$ = jQuery);
Something went wrong with that request. Please try again.