Hi,
This is more of a requirejs problem than a django-require one, but I'll do my best!
Basically, I'd suggest making your base URL the root of your JS structure, and making your main module live in the top level of the base URL. If this means using the paths config to fix a few paths, then that's okay.
In my experience, placing main modules anywhere but the root of the base URL is a bit of a pain with requirejs.
--
You received this message because you are subscribed to the Google Groups "django-require discussion and announcements" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-requir...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
The jquery issue was caused by the jQuery codebase declaring that the jQuery module is called "jquery", and not "lib/jquery". That is, unlike most AMD modules, it names itself explicitly rather than implicitly.
You can get around this by setting a paths config for jquery.
Hi,
Thank you, that helped me out. I've got it now all working including Almond.
I moved the REQUIRE_BASE_URL to "xilongocms/js" which gave me initially a problem.
In page_load.js, the first module loaded after the main (xilongo_loader.js) resulted in a Javascript error:
define(['lib/jquery'], function($) {
…
$ remains for some reason undefined. Hoewever, jquery.js is loaded in the DOM.
});
So I moved jquery.js to the REQUIRE_BASE_URL and that solved the problem. This issue did not occur with any of the other javascript resources in the lib folder like jplayer.js and some UI stuff.
Why I can not have jquery.js in the lib folder remains a mystery to me. The last time I changed REQUIRE_BASE_URL to the js/lib folder to get that working but that obviously was not the solution. In the requirejs documentation I do not find an explanation either; it covers retrieving jquery.js from a CDN or making use of a jquery-require packages but I miss a straightforward example with jquery. Of course this is indeed a requirejs issue and not related to django-require.
Anyway, thanks again,