I'm new to RequireJS, and I'm trying to load a plugin using the shim technique. Ideally I'd like to keep the plugin in a different directory as well.
No matter what I do, I get a script error (even when the plugins are in the base directory.) Here's my RequireJS config. picker.date.min requires picker.min
require.config({
baseUrl: '/js',
paths: {
jquery: 'vendor/jquery/jquery-2.0.3.min',
pickadate: 'vendor/pickadate/picker.min',
pickadatedate: 'vendor/pickadate/picker.date.min'
},
shim: {
jquery: {
exports: '$'
},
pickadate: ['jquery'],
pickadatedate: ['jquery', 'pickadate']
}
});
Here's the script I use on my page
require(['jquery', 'pickadate', 'pickadatedate'], function($) {
$('#start_date').pickadate();
});
The error I get is: GET http://domain.com/js/pickadate.js 500 (Internal Server Error) require-jquery.js:1854 Uncaught Error: Script error
Can anyone help?