I need to implement a login component and routing path in my application, even though there is no traditional login page as the authentication will be handled through a Single Sign-On (SSO) system. The purpose of adding this login functionality is to allow our Quality Assurance and Development teams to work more efficiently.
While I am aware that I can control the deployment of components using an environment.ts
file with a production property, I want to ensure that the login component and routing are not included in the source files for production deploys.
Although building external tools such as a Chrome extension or desktop app is an option, due to the multiple environments we have, I would rather have a direct link within the application to enable/disable this feature.
Is there a way, perhaps utilizing some form of @Attribute
, to exclude specific chunks of code based on the environment? Are there any best practices for achieving this kind of functionality? I suspect that if it is possible, it may involve features of Typescript and Webpack.