-
Notifications
You must be signed in to change notification settings - Fork 12k
Environment as external chunk #2929
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
I guess you're thinking of doing something like a I wonder if this sort of functionality should wait until we have Universal merged because at that point, we can actually use environment variables and inline the configuration inside index.html upon serve. Your Docker container would be a node service at that point. |
Yep using 'sed' is the way I thought of. Could you please give more details about using env variables? How will it work? |
well ideally if you had an actual node app (NG Universal delivering index.html), we could inline the config inside there using middleware. We could replace the original environment.ts values on runtime inside import { environment } from 'environments/environment';
environment.apiEndpoint = process.env.API_ENDPOINT;
// And then some middleware that inlines environment into index.html |
Dupe of #2508 |
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. |
Hi,
this is feature proposition. I know already how environments should be use and it is quite ok. What would be nice is to put final environment.js as external chunk so it is loaded from environment.js located somewhere next to index.html.
Motivation:
I use docker for deployment. I found it really nice option to configure some properties (like backendUrl) at deployment time and not build time.
Having environemnt in external file it would be easy to override them when docker starts by providing env variables.
The text was updated successfully, but these errors were encountered: