// Anonymous empty module. | |
define(); | |
// Anonymous values. | |
define({}); | |
define(true); | |
define(1234); | |
define(null); | |
define(undefined); | |
// Anonymous function. | |
define(function() {}); | |
// Anonymous function with dependencies. | |
define(["depA"], function(depA) {}); | |
// Anonymous CJS. | |
define(function(require, exports, module) {}); | |
// Anonymous mixed dependencies and CJS. | |
define(["exports", "depA"], function(exports, depA) {}); | |
// Named module. | |
define("name"); | |
// Named module values. | |
define("name", {}); | |
define("name", true); | |
define("name", 1234); | |
define("name", null); | |
define("name", undefined); | |
// Named function. | |
define("name", function() {}); | |
// Named function with dependencies | |
define("name", ["depA"], function(depA) {}); | |
// Named CJS. | |
define("name", function(require, exports, module) {}); | |
// Named mixed dependencies and CJS. | |
define("name", ["exports", "depA"], function(exports, depA) {}); |
// Empty require. | |
require(); | |
// Set a configuration. | |
require({ baseUrl: "" }); | |
// Require a resolved module. | |
require("modA"); | |
// Require an unresolved module. | |
require(["modA"]); | |
// Set a configuration and require. | |
require({ baseUrl: "" }, "modA"); | |
// Set a configuration, require, and do nothing else. | |
require({ baseUrl: "" }, ["modA"]); | |
// Require an unresolved module and callback. | |
require(["modA"], function(modA) {}); | |
// Set a configuration, require an unresolved module, and callback. | |
require({ baseUrl: "" }, ["modA"], function(modA) {}); |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
Show comment Hide comment
juandopazo
commented
Jan 18, 2014
define(["exports", "depA"], function(require, depA) {}); Bad copy-paste? |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
Show comment Hide comment
tbranyen
Jan 18, 2014
@juandopazo I had accidentally used require
before instead of exports
to indicate CJS. Fixed and updated, thanks for the catch!
@juandopazo I had accidentally used |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
Show comment Hide comment
wangpung12
commented
Feb 1, 2018
Good |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Bad copy-paste?