Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

RequireJS and NodeJS support #900

Closed
stevenvachon opened this issue Jan 11, 2014 · 3 comments · Fixed by #1200
Closed

RequireJS and NodeJS support #900

stevenvachon opened this issue Jan 11, 2014 · 3 comments · Fixed by #1200

Comments

@stevenvachon
Copy link

This is taken from the bottom of jQuery:

if ( typeof module === "object" && module && typeof module.exports === "object" ) {
    // Expose jQuery as module.exports in loaders that implement the Node
    // module pattern (including browserify). Do not create the global, since
    // the user will be storing it themselves locally, and globals are frowned
    // upon in the Node module world.
    module.exports = jQuery;
} else {
    // Register as a named AMD module, since jQuery can be concatenated with other
    // files that may use define, but not via a proper concatenation script that
    // understands anonymous AMD modules. A named AMD is safest and most robust
    // way to register. Lowercase jquery is used because AMD module names are
    // 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.
    if ( typeof define === "function" && define.amd ) {
        define( "jquery", [], function () { return jQuery; } );
    }
}
@madrobby
Copy link
Owner

Hi there! We currently have no plans to add support for loaders that need code changes, mostly because it's a nightmare to support. You can easily add this code on your own if you require it. Note that Zepto doesn't have a noconflict method.

@stevenvachon
Copy link
Author

It's a nightmare to support RequireJS? I wouldn't have thought that was the case.

I can't add it myself as this request was in hopes of making my favourite framework even better. Adding it would require others to add it.

@madrobby
Copy link
Owner

@stevenvachon please see the discussion in #342

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants