The UseResource extension adds the <usescript> and <usestyle> tags that allows JavaScript and CSS in the MediaWiki namespace to be loaded on a per-page basis.
<usescript>
<usestyle>
For more information see https://www.mediawiki.org/wiki/Extension:UseResource.