-
Notifications
You must be signed in to change notification settings - Fork 12k
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
feat(@angular/build): set development/production condition #28531
Conversation
02af1d0
to
6751bae
Compare
The changes themselves should be in fairly good shape but leaving as draft until the next tooling meeting. |
Will there be a condition for the SSR vs client build also? |
I think that should already exist. I've used the "browser" condition successfully which comes with esbuild/Vite natively. |
67bdb23
to
646bd39
Compare
Ensures that we consistently set "development" for non-optimized and "production" for optimized builds. This is consistent with other bundlers (Vite/webpack/parcel/...).
646bd39
to
ace6617
Compare
I removed the code for |
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. |
Ensures that conditional exports/imports work as intended in
ng serve
andng build
:This allows quick conditional logic like the following to work as expected:
The file can be switched in the
imports
field inpackage.json
:Something similar already (and continues to) work for SSR vs browser code.
The difference can be expressed using the "browser" condition:
References: