What would be the benefit to minify/uglify the JS with Ionic?
According to me, it only makes sense when dealing with network.
But if the app runs locally on devices…
If this is needed, I thought about moving the standard js folder containing non-minified js outside the www structure.
Then with a gulp task, I would be able to populate this empty js folder with ONLY minified/uglified JS.
So that my build would contain only those files and not the original.
Is this a good practice?
Yes, it would be a very good practice! And in my opinion it wouldn’t be bad for ionic to implement such a way by default.
Minify your JS because your app package size will be reduced, your users will be thankfull if your app is not taking up 50mb, but 45mb. Many phones don’t have unlimited disk storage, espescially the older devices. Also, your app will download faster while installing. In my opinion those two reasons are enough to make it worth the work!
Minified JS runs faster. Javascript is an in-memory language, basically it loads all your javascript in memory and executes the script. Yes, less white spaces and uglified variables could improve performance (but it’s pretty small and you pobably won’t visually notice). Also, even when the files are “downloaded” from local, the files have to be loaded from disk into memory, which obviously is faster when your files are smaller!
I would absolutely recommend minify and uglify your js