-
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
File replacements are ignored for web workers #29546
Comments
same here after upgraded to 18 and started to use esbuild |
We are investigating this issue. However, please consider switching to using conditional imports (https://angular.dev/tools/cli/build-system-migration#import-export-conditions) if possible. These provide improved capabilities for the common development/production use case including type-checking, improved IDE support, and leverage established methods for defining conditional behavior. A partial |
Thanks for the recommendation, it looks promising. Unfortunatly, I believe this does not suit our needs as we currently have three different deployment setups (dev, stage, prod) with different file replacements for each. From what I've gathered, your suggested solution only supports differentation based on the |
Currently that is correct in that it works for production/development as well as browser/server bifurcation but not any additional. We are evaluating an added configuration option to support custom resolution conditions. This should handle the staging case as well as other more complex resolution scenarios. One of the benefits of the condition-based resolution is flexibility in configuration such as nested conditions and patterns. |
Same here, updated to v19 and now the Workers' code is compiled with the development environment file instead of production. |
I have tried this solution but I get this error: |
That error may indicate a configuration issue with the application's
|
Command
build, serve
Is this a regression?
The previous version in which this bug was not present was
v18
Description
Hi, we recently updated to angular v19. During that we also migrated the builder to the recommended
@angular/build
builder, but in my tests the error also occured for the old devkit builder. After the update, we noticed that file replacements are ignored for web workers, see minimal reproduction. Before our upgrade, this was working without problems. I'm happy about any help :)Minimal Reproduction
StackBlitz: https://stackblitz.com/edit/4gqtqodb
After everything was built, you will see in the console:
However, as defined in the
angular.json
, the fileenv.ts
should be replaced byenv.prod.ts
, which is done correctly in the component.Exception or Error
Your Environment
Anything else relevant?
Seems to happen for both build and serve, local and on stackblitz and for both the devkit and the new builder.
The text was updated successfully, but these errors were encountered: