Just getting started with requirejs. I have a main app.js script in which I've set up my require.config etc. I want my file structure to look like this:
index.html
/js
app.js
/partials
jquery-functions.js
lightslider-functions.js
Wherein the actual custom scripts are being held in partial files that are specific to plugins/libs, and get called from app.js with all the correct dependencies. How do I define a module with a different-than-standard relative path?
require.config({
baseUrl: '../js',
shim: {
lightslider: {
deps: [
'jquery'
]
},
featherlight: {
deps: [
'jquery'
]
}
},
paths: {
'jquery': [
// CDN
'//code.jquery.com/jquery-1.11.3.min',
// LOCAL FALLBACK
'libs/jquery/jquery-1.11.3.min'
],
'featherlight': [
// CDN
'//cdn.rawgit.com/noelboss/featherlight/1.3.4/release/featherlight.min',
// LOCAL FALLBACK
'libs/featherlight/featherlight.min'
],
'pikaday': [
'libs/pikaday/pikaday'
],
'lightslider': [
'libs/lightslider/lightslider.min'
],
'modernizr': [
// CDN
'//cdnjs.cloudflare.com/ajax/libs/modernizr/2.8.3/modernizr',
// LOCAL FALLBACK
'libs/modernizr/modernizr'
]
},
});