Instead load it via mw.loader.using We retain the module name ext.popups as this will be present in cached HTML, however now it will load the bulk of the code inside ext.popups.main Bug: T176211 Change-Id: Ibe212721807d3698dc45ef46b2dbde15ca9d2f70