Performance: One JS file per controller or one large JS file

Is there much of a difference in performance by splitting each controller up into it’s own seperate JS file?

I assume all of the files only need to load once during the runtime of an Ionic app?

Does the answer on the link below apply to web applications more so than an ionic app?

Well … for developing , split the controllers/services into seperate files so you can structure your files. But when you compile to android/ios, you need to concat everything to 1 big file.

You can use John Papa style guide :

You really don’t need lazy loading on an ionic app (on real device), because you won’t be updating the files.

That’s my opinion

1 Like