requirejs-config.js
1.12 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
var base = window.location.href;
var host = window.location.host;
var regex = new RegExp(".*" + host + '/', "g");
if(host){
base = base.replace(regex,'');
}else{
base = base.replace('index.html','');
}
base = removeUrlParameters(base);
requirejs.config({
baseUrl: ( base + '/js/'),
waitSeconds: 0,
paths: {
jquery: 'jquery-2.1.3.min',
jquery_ui: 'jquery-ui-1.11.4.custom/jquery-ui.min',
jquery_cookie: 'jquery.cookie',
handlebars: 'handlebars-v3.0.1',
handlebars_helpers: 'handlebars-helpers',
jquery_maxlength: 'jquery.maxlength.min',
layout: 'layout',
main: 'main'
},
shim: {
'handlebars':{
deps: ['jquery'],
exports: 'Handlebars'
},
'jquery_ui': {
deps: ['jquery']
},
'layout': {
deps: ['jquery']
},
'jquery_maxlength': {
deps: ['jquery']
},
'handlebars_helpers':{
deps: ['handlebars']
}
}
});
requirejs(['jquery', 'jquery_ui', 'jquery_cookie', 'handlebars', 'handlebars_helpers']);
requirejs(['jquery_maxlength', 'layout', 'main']);