I'm having a hard time here, I'm trying to load non-AMD modules jquery / lodash / underscore before any of my AMD modules will be loaded. I know that I should use 'shim' and I do. Evertyghing seems to work in every browser except IE8 and less. Is there some kind of workaround for IE7/8 ?
I've took a look at 'use' plugin / 'order' plugin and wrapping global variables into AMD modules (http://tbranyen.com/post/amdrequirejs-shim-plugin-for-loading-incompatible-javascript). Everything faild. Any ideas of how should it be done?
EDIT
require.config({
use: {
backbone: {
deps: ["underscore", "jquery"],
attach: "Backbone"
},
underscore: {
attach: "_"
},
jquery : {
attach: 'jquery'
}
},
paths: {
'underscore': 'lodash-1.3.1.min',
'backbone': 'backbone-1.0.0.min',
'jquery': 'jquery-1.10.2.min',
}
});
require([
'use',
'jquery',
'underscore',
'backbone',
'app',
], function($) {
'use strict';
});
'use' is the use.js plugin. I've also used 'shim' before.
EDIT 2
shim: {
'app': {
deps: ['backbone']
},
'backbone': {
deps: ['underscore', 'jquery'],
exports: 'Backbone'
},
'underscore': {
exports: '_'
},
'jquery' : {
exports: 'jquery'
},
},
my shim config. REQUIREJS VERSION IS 2.1.10.
Edit 3:
require.config({
paths: {
'underscore': '//cdn.vgc.no/js/libs/lodash/lodash-1.3.1.min',
'backbone': '//cdn.vgc.no/js/libs/backbone/backbone-1.0.0.min',
'jquery': '//cdn.vgc.no/js/libs/jquery/jquery-1.10.2.min'
},
enforceDefine : true
});
require([
'jquery',
'underscore',
'backbone'
], function($, _, Backbone) {
'use strict';
console.log($);
console.log(_);
console.log(Backbone);
})
does this should work under IE8 ?

enforceDefineandexportsset as I suggested in your other question? If it is because you useuse, then don't useuse. There's nothing in your question that suggests to me you should be usinguse. Did I miss something? - Louisshimconfiguration. Also, make sure you are using RequireJS 2.x becauseshimdoes not exist in the 1.x series. (It happened that we've had questions asked here on SO where the problem was the the user used an old version of RequireJS.) - Louisexports. - asgoth