Currently I think there is no way to configure requirejs paths.
Also - the requirejs config is 'global' and all entries included on every page.
Would be good improvement if there were some more flexibility in config and more contributions was possible.
As part of 5.4 migration process we have some components that make use of JQueryFileUpload, https://github.com/blueimp/jQuery-File-Upload .
This library uses the factory approach for defining the modules to work in both AMD and non AMD environments.
Internally it handles loading of required modules, but work with paths. (And does not try to load from a fixed directory structure).
So I think I need to specify things like
Currently, only option is to configure shims through tapestry's modulemanager, but that's for non-AMD scripts and is likely to cause problems.
Also the shim config would be global (all pages) - which I'd like to avoid as well.
In 5.3 I've used a JQueryFileUpload to define all the deps like so..
List<Asset> ret = new ArrayList<Asset>();
It would be useful it was possible somehow to contribute to requirejs configuration through stacks.
That way they could be added to the requirejs config if the stack was used.
I have no idea about the implications of this and if it's possible to accomplish, but could potentially help solving some more advanced use cases.