https://github.com/joakin/update-resourceloader-config-plugin
Update extension.json for mediawiki's resourceloader config with frontend modules for the webpack entry points.
https://github.com/joakin/update-resourceloader-config-plugin
Last synced: about 2 months ago
JSON representation
Update extension.json for mediawiki's resourceloader config with frontend modules for the webpack entry points.
- Host: GitHub
- URL: https://github.com/joakin/update-resourceloader-config-plugin
- Owner: joakin
- Created: 2015-08-24T12:24:05.000Z (almost 11 years ago)
- Default Branch: master
- Last Pushed: 2015-08-24T20:18:36.000Z (almost 11 years ago)
- Last Synced: 2025-03-12T04:20:59.161Z (over 1 year ago)
- Language: JavaScript
- Size: 121 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
UpdateResourceLoaderConfigPlugin
================================
Webpack plugin for automatically adding ResourceLoader frontend modules to
a `extension.json`. It'll extract i18n labels and required mobileFrontend
modules with `mw.mobileFrontend.require`.
```
npm install --save-dev update-resourceloader-config-plugin
```
Then on your `webpack.config.js` add it to the plugins:
```js
var conf = {
entry: {
'resources/ext.gather.special.collection/init': './resources/ext.gather.special.collection/init.js'
},
output: {
path: path.join(__dirname, 'build'),
filename: '[name].js'
},
module: {
loaders: [
// ...
]
},
plugins: [
new UpdateResourceLoaderConfig({
i18n: 'mw.msg'
})
]
};
```
In this case it will create an entry
`resources/ext.gather.special.collection/init` in `extension.json` containing
the entry script, the i18n labels and the dependent modules required found.
Like this:
```json
{
"//": "...",
"ResourceModules": {
"resources/ext.gather.special.collection/init.js": {
"targets": [
"mobile",
"desktop"
],
"group": "other",
"dependencies": [
"ext.gather.api/CollectionsApi",
"Button",
"Icon",
"ext.gather.collection.confirm/ConfirmationOverlay",
"ext.gather.logging/SchemaGatherFlags",
"toast"
],
"scripts": [
"build/resources/ext.gather.special.collection/init.js"
]
}
}
}
```