How can I load different mode js dynamically?

I am a web backend developer, I use codemirror in old style not nodejs/webpack.
I include codemirror like this way ( use () to make it can be display):
(script type=“text/javascript” src="/static/modules/codemirror/5.48.0/lib/codemirror.js")(/script)
If I add a mode support, this language can be display properly in codemirror:
(script type=“text/javascript” src="/static/modules/codemirror/5.48.0/mode/javascript/javascript.js?ver=3")(/script)
Now because there are so many mode, if I want to load a mode dynamically, not want to load them all, how can I do it?

Try this addon.