0

I'm working on a page that is in progress of transitioning from script tags to require.js. This means that some dependencies are loaded via <script> and others via require.

For the most part, in my require modules I can still treat global scripts as modoules (and thereby help the transition) by doing something like this in my bootstrapping file

define('Globalize', Globalize);
define('knockout', ko);

However this won't work with jQuery since it is a function and require will try to invoke it as a callback. Is there a way to tell require "yes this is a function but return it directly, don't try to invoke it"?

And yeah, I can't just load jquery twice because I've got bootstrap modifying it, and things depending on bootstrap

4

1 回答 1

1

Oh...

define('jquery', function() { return window.jQuery}); 

duh.

于 2013-10-23T18:16:24.470 回答