The issue you're hitting is that when you upload via the IDE, the code is executed/interpreted as it is uploaded - the actual JS text never exists in Bangle.js's RAM in one big block.
When you save to a file, Espruino has to load that whole file into RAM and execute from there.
So if you have to split the file up to save it, you may well hit issues trying to load/execute it too :(
You've got two main options I guess:
Split your app into multiple files - have one main one that loads, and then 'eval' extra files from Storage. Even better if you can do it as/when they're needed.
Minify your code and upload the minified version to a file. At some point the IDE will be modified to do it all for you, but right now it's a little more tricky (but a lot easier than what you had to do to upload the code!)
I'm planning on adding the ability to execute JS code directly from external storage which would basically solve all your issues, but that's going to need a bunch of testing before I can put it live.
Espruino is a JavaScript interpreter for low-power Microcontrollers. This site is both a support community for Espruino and a place to share what you are working on.
The issue you're hitting is that when you upload via the IDE, the code is executed/interpreted as it is uploaded - the actual JS text never exists in Bangle.js's RAM in one big block.
When you save to a file, Espruino has to load that whole file into RAM and execute from there.
So if you have to split the file up to save it, you may well hit issues trying to load/execute it too :(
You've got two main options I guess:
I'm planning on adding the ability to execute JS code directly from external storage which would basically solve all your issues, but that's going to need a bunch of testing before I can put it live.