When and why NOT to use `--prod` for building?

What would be a reason or time not to use --prod in the build command to get an optimized (smaller, faster) build of my Ionic app? What is the benefit of doing a build without it?

You use --prod to deploy your app (minify your code, removing debugging capabilities, …)

See Production Builds in the docs

If you are deploying your app then use --prod, if you are developing locally and want to debug your app then don’t use it.

1 Like

--prod doesn’t remove the debugging capabilities, that is --release for the cordova command.

I am really interested in when I do not want to minify and optimize my code and why…

I think the only benefit would be build time. When it was introduced there were a lot of discussions and complaints, at least on the forum and github, about build speed, so I’m guessing that’s the reason why it’s not the default behavior.

Except for ionic serve, I always add --prod

4 Likes