Skip to content

fix the document: --prod vs. --env=prod #12

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
hiepxanh opened this issue Mar 7, 2017 · 3 comments
Closed

fix the document: --prod vs. --env=prod #12

hiepxanh opened this issue Mar 7, 2017 · 3 comments

Comments

@hiepxanh
Copy link

hiepxanh commented Mar 7, 2017

image
angular CLI update to new version
you should fix
from: ng build --prod --base-href "https://USERNAME.github.io/REPOSITORY/" to : ng build --prod --base-href "https://USERNAME.github.io/REPOSITORY/"

this will make this won't render error Can't resolve './$$_gendir/app/app.module.ngfactory'

@JohannesHoppe
Copy link
Member

hmmm... generally --prod and --env-prod should yield to exactly the same result?! 🤔

@fmalcher ?!

@fmalcher
Copy link
Member

fmalcher commented Mar 7, 2017

--prod and --env=prod are actually not doing the same.
While --env=prod just selects the environment file, --prod also selects the production target (which is the same like --target=production). This enables AOT compilation, minification and tree shaking.

In above screenshot you see that for --env=prod there are no hash values in the bundle file names. This indicates that the development target is enabled and thus, JIT compilation is taking place.

To sum up, changing the command to --env=prod does not solve the actual problem. It just bypasses the AOT issue by disabling AOT ;-) The problem is connected to the Angular CLI, not to angular-cli-ghpages.

@hiepxanh @JohannesHoppe

@fmalcher fmalcher closed this as completed Mar 7, 2017
@hiepxanh
Copy link
Author

hiepxanh commented Mar 7, 2017

thanks for your explain

@JohannesHoppe JohannesHoppe changed the title fix the document fix the document - --prod vs. --env=prod Mar 7, 2017
@JohannesHoppe JohannesHoppe changed the title fix the document - --prod vs. --env=prod fix the document: --prod vs. --env=prod Mar 7, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants