How to separate RPG Maker MV JS files

Hello!

New to the forum so I apologise if this isn't quite the right place for this... It's not technically achieved with JS, so I didn't post it in the JS section of the forums.

Anyway, a friend and I are working on a game in MV, and he was keen on being able to separate out each function into its own JS file (partial) so that it was A) more readable and B ) easier to drill down to exactly which code in the core you wanted to overwrite with whatever plugin it is you're developing.

Something like this may already exist, but if you're interested - check out the repo here; it's a PHP script. All you have to do is edit the script and put in the correct paths to where your project code is and run the file once on a local dev environment or appropriate CLI.

https://github.com/gimmer/RPGMakerMVSplit

The result is all JS scripts in their own folders. This will also add all the <script> tags to your index.html for the game:

giphy.gif
Moved to: Useful Development Tools

Original thread: https://forums.rpgmakerweb.com/threads/how-to-separate-rpg-maker-mv-js-files.115205/