-
Notifications
You must be signed in to change notification settings - Fork 12k
Something changed in fileReplacements and assets with Angular 9 #16779
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
Hi, this used to work unintentionalaly as The The way this can be done is by having the configuration files in separate folders and setting the assets option as follows and configure different assets for each environment. "assets": [
"src/favicon.ico",
"src/assets",
{
"input": "src/deployment/staging",
"output": "/",
"glob": "*.yml"
}
], |
Thank you, I will use the approach you suggested. |
Closing as this feature is working as per design. |
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. |
🐞 Bug report
Command (mark with an
x
)Is this a regression?
Yes, the pipeline to build/deploy was working in Angular 8.2, the behaviour changed migrating to Angular 9.rc10
Description
The way that angular.json configuration for "fileReplacements" and "assets" works has changed.
🔬 Minimal Reproduction
To deploy with CloudFoundry I need to provide an environment specific manifest.yml file.
So I have a manifest.{env}.yml for each environment.
In 8.2, I was specifying to replace the manifest file with "fileReplacements", and then adding the manifest.yml as an "asset" to push to CloudFoundry.
For example for the environment "staging" I would have:
/src/deployment/manifest.staging.yml
/src/deployment/manifest.yml
The first step here would be fileReplacements kicking in, moving the content from manifest.staging.yml inside manifest.yml
The second/last step is manifest.yml being included in dist through the "assets" configuration, but with the staging's configuration inside.
Instead, after migrating to Angular 9.rc10, fileReplacements doesn't happen in time and manifest.yml has the content of the original (non-staging) one.
As a possible fix I tried this approach:
I tried to change my assets configuration to grab directly the manifest file:
{
"glob": "manifest.staging.yml",
"input": "apps/appointment-manager/src/deployment",
"output": "manifest.yml"
},
I expected:
dist/manifest.yml
Instead I got:
dist/manifest.yml/manifest.staging.yml
the output was read as a directory where to place the content.
🔥 Exception or Error
Nope.
🌍 Your Environment
Anything else relevant?
The text was updated successfully, but these errors were encountered: