Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.
Sign upConfiguration 'production' is not set in the workspace when --prod and -c flags set #35663
Comments
|
Since 6.0,
|
|
Thanks for the quick response. We were thrown off by the documentation on deployment that implied that the --prod flag actively enabled certain build steps. https://angular.io/guide/deployment#production-optimizations |
|
I can see how that could cause confusion. I'll add a task to the backlog regarding a clarification to that section and I'll re-open this issue to track it here as well. |
Given @clydin's reply I would assume that a correct command would be |
|
@ahsteele In regards to the
|
|
Hey guys, Anyone coming in for the first time creating lib, i'm sure will be reading this: It specifically details the need not to use Ivy and use the --prod option as below screen shot. |
|
@redevill same problem here cant build the library into production mode. Configuration 'production' is not set in the workspace. |
|
@Theinfinix500 - Well, the blind leading the blind - From what I can make out (meaning, that from what I have read and observation of behavior) the using the prod flag is no longer needed. I took the output from a build without the prod flag, and copied it to my node_modules. "pretending" that I did an npm install on the new library. Then referenced it in code. From a compile standpoint, this is working. Still need to see if the library functions correctly, and if the published version behaves the same. Hopefully someone with more knowledge will chip in. |
|
I have 3 different environments on my side and i have been building packets using the following command. with separate output folders and separate environment.ts files. How do i set it up now? |
|
I just had a look at the code in angular cli
If the
So the comment says, that a |
|
A follow up from my previous comment - I published the library, and it appears to behave just fine. Using the "default" no flag supplied build option. |
|
in addition I've just found OTOH what worked for me as per https://angular.io/guide/ivy there is dedicated
|
|
Status: Docs team needs engineering input in order to correct/clarify documentation. |



Command (mark with an
x)Is this a regression?
Yes, this command did not generate errors using Angular 8
Description
We have renamed the production build configuration to "release" in our angular.json file for internal consistency. Prior to upgrading to Angular 9 this worked without issue. Now when we run
ng build -c=release --prod --aotwe get the following error.An unhandled exception occurred: Configuration 'production' is not set in the workspace.While we can rename our release configuration to production we have a lot of projects and it breaks our internal naming convention. Since it was working prior to the upgrade we thought it was worth bringing up here before we refactor.
Create a new Angular project using the CLI.
Rename the production build configuration to release (or anything else).
Run
ng build -c=release --prod --aotGet Error
Anything else relevant?
Shouldn't be anything else.