Is it possible to have requirejs configuration in one place and reuse it in modules?
such as
main.js:
requirejs.config({ baseUrl: "static/js", paths: { "jquery": "http://code.jquery.com/jquery-1.9.1.js", "jquery-ui": "http://code.jquery.com/ui/1.10.2/jquery-ui.js" }, shim: { "jquery-ui": { deps: ["jquery"] } } });
and
public.js:
define(["main", "jquery", function(main, $) {
client.js:
define(["main", "jquery", function(main, $) {
And on my public part of the network there is
<script type="..." src="js/require.js" data-main="js/public.js"></script>
And on the client side of the website
<script type="..." src="js/require.js" data-main="js/client.js"></script>
And also I would like to have a module for each page. So, for example, to have an index module for the public
<script ...> require('public/index'); </script>
and
public / index.js:
define(["jquery", "slideshow"], function($, s) { $( function() { s.init() } ); });
Is this possible with RequireJS?
Thanks for answers.