I am using Require.js for my current project.
And I used to download Require.js config with the required variable, for example
require = { paths: { backbone: "libs/backbone-min", bootstrap: "libs/bootstrap.min", jquery: "libs/jquery-1.7.2.min", underscore: "libs/underscore-min", order: "plugins/order", text: "plugins/text", use: "plugins/use" } }; <script src="http://local.gungroo.com/app/js/config.js"></script>
This worked fine in all browsers.
I recently switched to Coffescript and the generated code is similar to
(function() { window.require = { paths: { backbone: "libs/backbone-min", bootstrap: "libs/bootstrap.min", jquery: "libs/jquery-1.7.2.min", underscore: "libs/underscore-min", order: "plugins/order", text: "plugins/text", use: "plugins/use" } }; }).call(this);
But the second is torn in IE8.
IE8 handles "var require" and "window.require" variables differently?
source share