The MediaWiki software let's you edit a Javascript file on its wiki by going to a URL, such as wiki.example.com/MediaWiki:Common.js
. (With sufficient privileges) you can "edit" that file the same way you would any wiki page, and when you save it the users of the site will see the new version.
I would very much like to be able to interject Babel.js into that process. Babel.js is a command-line (Node-based) program that allows programmers to write modern code, but have it "downgraded" (transpiled) to be backwards compatible with older browsers. You basically run babel inputFile.js outputFile.js
and then use the outputFile.js it generates.
Ideally I would love an extension, configuration option, resource loader, or whatever that would let me run Babel on files after a wiki user saves them. Instead of users seeing the original files, I'd want them to see the Babel-generated files.
Is this possible?
Failing that, if anyone knows of any MediaWiki extensions that work in a similar way (running a command line program and using it's output after a wiki "page" is saved), but for some other type of file or with another command line program, that would be helpful to know of also.
babel.js
.