I got something like this:
ng build --prod --no-aot
But I am not able to understand what is the difference between
ng build --prod
and
ng build --prod --no-aot
Remove any -Xjit and -Xaot options (and accompanying parameters) from your command line. Use the -Xint command-line option to disable the JIT and AOT compilers.
By default, aot is set to true for new CLI applications. See the CLI command reference and Building and serving Angular apps for more information.
The ng build command with the --prod meta-flag (ng build --prod) compiles with AOT by default. Why compile with AOT? With AOT, the browser downloads a pre-compiled version of the application. The browser loads executable code so it can render the application immediately, without waiting to compile the app first.
Starting with Angular version 9, the default compilation of choice is AOT. This means that whenever you build your Angular application for production with the command ng build --prod , the application will also be compiled as part of the build process.
Use the following command to disable AOT mode:
$ ng build --prod --aot=false --build-optimizer=false
Just run command ng build -prod -aot=false
. This will disable the aot compiler.
The flag --prod
does the AOT compilation by default. If you want to build without AOT then simply run ng build
only without any flag.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With