Closed paulfairless closed 11 years ago
This template reads requirejs configuration literally by specifying of requireConfigFile
key name. Variable isn't supported by literal parsing.
Is it an elegant way to load different jQuery by specifying different path? The question is worth discussing.
But, I show you my workaround as well.
require.config({
"jquery1": "src/jquery1",
"jquery2": "src/jquery2",
"shim": {
"jquery1": {
exports: '$'
},
"jquery2": {
exports: '$'
}
},
"map": {
"*": {
"jquery": "src/jquery"
},
}
});
define('querySelector' in document
&& 'localStorage' in window
&& 'addEventListener' in window ? ['jquery1'] : ['jquery2'], function($) {
return $;
});
Is there any way around this? This is kind of a big problem for me. I use lots of variables in my config file for path prefixes, etc.
Hi,
I'm having an issue trying to set up my jasmine tests due to a conditional requireJS path for JQuery. We do detection to load JQuery 2 or JQuery 1 depending on browser capabilities.
This generates an error