chaplinjs/chaplin

Allow passing a custom controller loader

akre54 opened this issue · 1 comments

It'd be great if we could pass a custom controller loader to our application init that would override Dispatcher#loadController. This should accomplish a number of things, but crucially it should allow Chaplin to work better with loaders like WebPack, which currently struggles with statically analyzing Chaplin's runtime requires. The proposed method would have the same signature and same side-effects (async load) as loadController.

Worked around this by overriding loadController (which required overriding initDispatcher in our Application). Ain't the cleanest but it works.