mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/CodeMirror
synced 2024-11-23 22:03:28 +00:00
ca02360228
See https://w.wiki/9Twh for example usage with ResourceLoader. Webpack is retired in favor of Rollup, which allows us to convert the ECMAScript Modules into CommonJS modules for use by ResourceLoader. We now have a file in dist/ for each RL module that we want to offer, including the 'lib' module which includes the CM library itself. Because Rollup has no knowledge of the ResourceLoader module registry, the generated output requires other modules via relative path, when it needs to be the RL module name. To get around this, we do a crude find/replace after the files are generated. Hacky, but necessary to make CodeMirror usable by gadgets and scripts that don't also want WikiEditor. Add new RL modules 'ext.CodeMirror.v6.lib' (vendor code) and 'ext.CodeMirror.v6' (the main CodeMirror class, sans WikiEditor). Clean up extension.json, listing the v6 modules beneath the old ones. Bug: T214989 Change-Id: Ide716247e545cf2bdd977bea645729564ebbe6e2
25 lines
395 B
JSON
25 lines
395 B
JSON
{
|
|
"root": true,
|
|
"extends": [
|
|
"wikimedia/client-es6",
|
|
"wikimedia/jquery",
|
|
"wikimedia/mediawiki"
|
|
],
|
|
"parserOptions": {
|
|
"sourceType": "module",
|
|
"ecmaVersion": 2022
|
|
},
|
|
"env": {
|
|
"browser": true,
|
|
"commonjs": true
|
|
},
|
|
"globals": {
|
|
"Tree": "readonly"
|
|
},
|
|
"rules": {
|
|
"es-x/no-array-prototype-includes": 0,
|
|
"es-x/no-class-fields": 0,
|
|
"es-x/no-rest-spread-properties": 0
|
|
}
|
|
}
|