PHPackages                             mwstake/mediawiki-component-thirdpartyresources - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. mwstake/mediawiki-component-thirdpartyresources

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

mwstake/mediawiki-component-thirdpartyresources
===============================================

Provides ResourceLoader module definitions that allow for inclusion of third-party pre-compiled resources (JS/CSS)

1.0.1(4y ago)077.8k↓43.4%GPL-3.0-onlyPHPCI passing

Since Feb 21Pushed 7mo ago5 watchersCompare

[ Source](https://github.com/hallowelt/mwstake-mediawiki-component-thirdpartyresources)[ Packagist](https://packagist.org/packages/mwstake/mediawiki-component-thirdpartyresources)[ RSS](/packages/mwstake-mediawiki-component-thirdpartyresources/feed)WikiDiscussions main Synced 2d ago

READMEChangelog (2)Dependencies (6)Versions (3)Used By (0)

MediaWiki Stakeholders Group - Components
-----------------------------------------

[](#mediawiki-stakeholders-group---components)

ThirdPartyResources for MediaWiki
=================================

[](#thirdpartyresources-for-mediawiki)

Provides ResourceLoader module definitions that allow for inclusion of third-party pre-compiled resources (JS/CSS).

**This code is meant to be used within the MediaWiki framework. Do not attempt to use it outside of MediaWiki.**

Use in a MediaWiki extension
----------------------------

[](#use-in-a-mediawiki-extension)

Add `"mwstake/mediawiki-component-thirdpartyresources": "~1.0"` to the `require` section of your `composer.json` file.

Explicit initialization is required. This can be archived by

- either adding `"callback": "mwsInitComponents"` to your `extension.json`/`skin.json`
- or calling `mwsInitComponents();` within you extensions/skins custom `callback` method

See also [`mwstake/mediawiki-componentloader`](https://github.com/hallowelt/mwstake-mediawiki-componentloader).

### Optional: Setting up `package.json`

[](#optional-setting-up-packagejson)

In MediaWiki extensions/skins, the `package.json` is usually just used for CI tasks, like `eslint`. Therefore one usually has only the `"devDependecies"` entry and the `node_modules/` directory is excluded from source code management e.g. via `.gitignore`.

If `npm` is used to pull in actual dependenies, it is recommended to copy the "dist" file(s) into the `resources/` (or `modules/`) directory of the extension/skin. This can easily be done by a `scripts.postinstall` entry.

Example `package.json`

```
"scripts": {
	"postinstall": "cp node_modules/some-package/dist/some-package.min.js resources/lib/"
},
"dependencies": {
	"some-package": "^1.0.0"
}
```

### Setting up the ResourceLoader module

[](#setting-up-the-resourceloader-module)

MediaWiki ResourceLoader may corrupt pre-packaged JS/CSS files, as it applies "minification". Also it may lack a proper `module.exports` statement, to make the third party code available to the consuming code.

To overcome such issues, use the `"class"` property of the `"ResourceModule"` definition like this:

```
"ResourceModules": {
	"ext.SomePackageComponent": {
		"class": "MWStake\\MediaWiki\\Component\\ThirdPartyResources\\ResourceLoader\\DistFiles",
		"packageFiles": [
			"lib/some-package.min.js"
		]
	}
},
"ResourceFileModulePaths": {
	"localBasePath": "resources",
	"remoteExtPath": "MyExtension/resources"
},
```

If a special `module.exports` is required, it can be specified in the `"module.exports"` property.

```
"ResourceModules": {
	"ext.VTreeView": {
		"class": "MWStake\\MediaWiki\\Component\\ThirdPartyResources\\ResourceLoader\\DistFiles",
		"module.exports": "SomePackageComponent",
		"packageFiles": [
			"lib/some-package.min.js"
		]
	}
},
```

###  Health Score

37

—

LowBetter than 81% of packages

Maintenance45

Moderate activity, may be stable

Popularity30

Limited adoption so far

Community12

Small or concentrated contributor base

Maturity51

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 75% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~3 days

Total

2

Last Release

1589d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/e39dfe9d3120de240053c4283e905254e8774d3278da25ad79974a8742c55192?d=identicon)[osnard](/maintainers/osnard)

![](https://www.gravatar.com/avatar/161c38b5448b71865cf0652b6974ed489dd3683b5d6e1814973cea6cb66c8f1d?d=identicon)[dsavuljesku](/maintainers/dsavuljesku)

---

Top Contributors

[![HamishSlater](https://avatars.githubusercontent.com/u/26261210?v=4)](https://github.com/HamishSlater "HamishSlater (3 commits)")[![osnard](https://avatars.githubusercontent.com/u/1201528?v=4)](https://github.com/osnard "osnard (1 commits)")

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/mwstake-mediawiki-component-thirdpartyresources/health.svg)

```
[![Health](https://phpackages.com/badges/mwstake-mediawiki-component-thirdpartyresources/health.svg)](https://phpackages.com/packages/mwstake-mediawiki-component-thirdpartyresources)
```

###  Alternatives

[opensoft/rollout

Feature switches or flags for PHP

2611.9M5](/packages/opensoft-rollout)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
