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

Export as named AMD module #233

Open
reisi007 opened this issue Apr 7, 2020 · 0 comments
Open

Export as named AMD module #233

reisi007 opened this issue Apr 7, 2020 · 0 comments

Comments

@reisi007
Copy link

reisi007 commented Apr 7, 2020

Expected Behavior

When using AMD modules, lozad should be a named AMD module, as one has to interact with it

Current Behavior

It is an anonymous AMD function

Possible Solution

define('lozad',[], function() {..})

instead of

define(function() {..})

Steps to Reproduce (for bugs)

Context

I need to import loadz in another module to initialize it.

Quote from jQuery:

// 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.

// 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

Tested on:

Applies to all AMD environments

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

No branches or pull requests

2 participants