We must wrap the compiled JavaScript of all Wikipedia.org entry points in wikitext so they contain tracking information that's usable by the tracking code in the Fundraising operation center and to be able to paste them into CentralNotice.
Acceptance Criteria:
- The output of a vite compilation wraps the compiled JavaScript in Wikitext
- The the output in the dist directory replaces the .js file with the wrapped .wikitext one
Implementation Details:
- Look at the existing code in webpack/mediawiki_text_wrapper.js to see the internal logic
- Vite uses rollup.js for bundling. The Plugin will be a a rollup plugin rather than a vite plugin. The most likely candidate to "hook into" is the generateBundle hook.
- Try to replace the Handlebars Library and the Handlebars template with ES6 tagged templates