Is it possible to require another requirejs app (with its own config) as a requirejs package? Say I have my main app and I want to require my standalone calendar widget. Is that possible?
Thanks in advance
edit
One way could be to require the optimized version of the widget?
RequireJS and CurlJS (the more commonly-used AMD loaders) allow you to re-configure local scope. See multiversion support docs
However, here is just a thought:
Rely as little as possible on config. It is very possible to set up only true generic, global things like
jquery,underscorepaths in global config and just roll named defines inside your widget for local packaging needs. For every config option James invented, there is a valid way to do it without a config.Shim can be easily emulated locally with nested require calls. Putting all plain JS aliases inside
pathsis perhaps useless because you can just as easily use direct refs to the plain js files “path/to/file*.JS*”In reality, you don’t really need config that much. Get away from needing it and your problem is simplified.