I'm not a frontend developer. Until a few days ago I haven't tried npm, webpack and typescript. But now (somehow) everything builds (you can find the code here).
But when I upload the extension (before the migration to TS it worked) and try to use it in MediaWiki I get an annoying message (annoying because I've spent a couple of weeks fighting in this world)
app.ts:378 Uncaught ReferenceError: mw is not defined
at MyClass.loadWikiArticlesAjax (app.ts:378:18)
at MyClass.initialize (app.ts:22:17)
at new MyClass (app.ts:18:17)
at ./includes/js/app.ts (app.ts:445:1)
at __webpack_require__ (bootstrap:19:1)
at startup:4:1
at startup:4:1
loadWikiArticlesAjax @ app.ts:378
initialize @ app.ts:22
MyClass @ app.ts:18
./includes/js/app.ts @ app.ts:445
__webpack_require__ @ bootstrap:19
(anonymous) @ startup:4
(anonymous) @ startup:4
app.ts:391 Uncaught TypeError: Cannot read properties of undefined (reading 'query')
at Object.success (app.ts:391:47)
at fire (jquery.js?7e265:3500:31)
at Object.fireWith [as resolveWith] (jquery.js?7e265:3630:7)
at done (jquery.js?7e265:9822:14)
at XMLHttpRequest.<anonymous> (jquery.js?7e265:10083:9)
Any hint?