jrburke/require-cs — Issue #13: Circular Dependencies with cs plugin don't work well.
Author: anotherbrain
Created: 2011-12-28 04:01:14+00:00
State: open

ref http://requirejs.org/docs/api.html#circular and https://github.com/jrburke/requirejs/tree/master/tests

# onecs.coffee
define [ "require", "cs!twocs" ], (require, two) ->
console.log two
one =
size: "large"
doSomething: ->
require "cs!twocs"

one

# twocs.coffee
define [ "require", "cs!onecs" ], (require, one) ->
console.log one
size: "small"
color: "redtwo"
doSomething: ->
require("cs!onecs").doSomething()

# circular-tests-cs.js
require({
baseUrl: "./"
},
["require", "cs!twocs"],
function(require, two) {
var args = two.doSomething();
doh.register(
"circular",
[
function circular(t) {
t.is("small", args.size);
t.is("redtwo", args.color);
}
]
);
doh.run();
}
);

#circular-cs.html

require.js: Circular Test

require.js: Circular Test

Check console for messages

Uncaught Error: Load timeout for modules: cs!twocs cs!onecs

What should I do ?

my English is not good.