I have a javascript module file that communicates with my database and I have a couple text/javascript files (screenshot below). In my text/javascript files I have users submitting highscores. So far I have been sending these to the browser local storage, retrieving them in the module file, and then exporting them to my database. For several reasons, this method does not seem sustainable as I further develop my app.
I did some research on how to get my files to "communicate" with each other but the only solution I can find is to re-define all my javascript files as modules, that way I can use the import function to share functions/variables. My question is, how do I get these files to communicate with each other? And is re-defining all js files to be modules feasible?