-
Notifications
You must be signed in to change notification settings - Fork 12k
Cannot run production build for ejected projects #5229
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
Comments
You can do this by using |
I've already figure this out. That's why I closed the issue ;) |
OK I think don't understand how |
@creat-or you can it's just how you do so can get opinionated pretty quickly. One common approach is to to have an environment variable , like Then later in your config you can use Taking a deeper dive would go waaay off topic. I bet there are blog posts about this somewhere. |
i think in an angular-cli ejected project the command |
Can we re-open this? @dagi12. Also whenever you do an |
Reopened |
Hey guys, any progress regarding this? |
+1. Seems like |
+1 Additionally, I would like to see --code-coverage supported on the test command. |
@hikumealan I think the code coverage in CLI works out of the box, at least with HTML/lcov. Plus IIRC the karma config is customizable with or without ejecting. |
I ran into this issue after running IMHO running So until an official solution presents itself, here's my workaround.
And here is what my npm scripts look like when I'm done.
|
it would be way more productive to be able to customize ng CLI build script instead of trying to merge dev/prod (generated) scripts based the the ENV variable the differences between the two generated files are huge and such a process is really prone to mistakes so far I copy 2 versions (dev and prod) of the ejected web pack config and the create a new webpack.config.js file:
so I can update cli and redo the ejection if needed and have a separate custom config |
eject functionality is no longer available in the latest version (6.0+). For custom webpack configurations the following unofficial add-on is a suggested solution: https://github.com/manfredsteyer/ngx-build-plus |
This issue has been automatically locked due to inactivity. Read more about our automatic conversation locking policy. This action has been performed automatically by a bot. |
Problem
I think title is quite self-explanatory here. Before app ejection I run
ng build -prod
For building production app. Unlike usual build this minify my project and does some other things.
After ejection there is a webpack configuration which as I think corresponds to usual build. There's no webpack configuration for production environment.
Possible fix
Project ejection should create production webpack configuration that will reflects
ng build -prod
behavior. And addwebpack --config -p webpack.config.prod.js
to scripts in package.jsonThe text was updated successfully, but these errors were encountered: