Closed GulajavaMinistudio closed 6 years ago
This will really impact the metrics as. In production mode with aot angular compiler is not loaded in the browser and compilation is done at build time. Thus reducing the chunk size as well as improves the performance as the compilation is not happening in the browser which is the case with the current build of this application.
The production build is already made. What the current scripts don't do is to run the build optimizer.
https://github.com/gothinkster/angular-realworld-example-app/blob/master/package.json#L8
@GulajavaMinistudio could you test this out locally and in case submit a PR?
Build optimizer is enabled by default on the current version of the cli
@juristr build optimizer does not need any setup its part of angular-cli
you just need to add a script
'prod': 'ng build --prod --build-optimizer'
and use this script to create the production build.
--build-optimizer
is just a flag that tells the cli to use aot build and optimize it for production.
@manishjanky Sure.
@Toxicable In fact I recall to have seen that somewhere in the changelog. Starting from which version of the CLI is that the case?
@juristr Im not sure on that one, Might have been around 1.5 or 1.6 at a guess.
closed via 399804ae6f34b52dbe6eb097009f29641e538ef4
Many thanks for response :)
I checking Angular Realworld Demo, but after i check in Inspect Element in Network Tab , this demo is not using production mode or production build. And the result is not fast as production mode.
Try run Production Build with this command
ng build --prod --build-optimizer
Docs https://angular.io/guide/deployment