Does it include the four Advanced Options? What does it do, exactly?
$ ionic build --help
➜ imoto-motoboys git:(master) ✗ ionic build --help
ionic build - Build web assets and prepare your app for any platform targets
ionic build will perform an Ionic build, which compiles web assets and prepares them for deployment. For
Ionic/Cordova apps, the CLI will run cordova prepare, which copies the built web assets into the Cordova platforms
that you've installed. For full details, see ionic cordova prepare --help.
Usage:
$ ionic build [options]
Options:
--prod ................... Build the application for production
Advanced Options:
--aot .................... Perform ahead-of-time compilation for this build
--minifyjs ............... Minify JS for this build
--minifycss .............. Minify CSS for this build
--optimizejs ............. Perform JS optimizations for this build
--prod flag minimizes and optimizes your entire project to a single file depending on type.
It also ignores plugins/imports which you have included but haven’t used.
Example -
All *.ts files gets compiled first and then all gets minified in a single file (main.js).
Similarly with ‘*.scss’ file too. They also get minified into a single file (main.css).
By doing this, you can publish your project for world without allowing users to easily inspect and copy codes from your project.
Also, there is a flag --release which you should use along with --prod to remove debuggabe flag from generated apk or ipa file.
As of app-scripts 3, building with --prod means building with those 4 advanced options, and also the Angular ngo tool (ngo short for Angular Optimization).
The Angular Ahead-of-Time (AOT) compiler converts your Angular HTML and TypeScript code into efficient JavaScript code during the build phase before the browser downloads and runs that code.