Angular Articles

OS Environment variables with Angular 7 and Custom Webpack

For a long time, server-side development enjoyed a rich set of Toolkits for development, build and deployment. One of the most convenient features is the ability to externalize configuration from the actual source code. API URL, secrets, threshold limits etc can be configured outside the actual code and exposed via Operating system’s environment variables. This promotes a good practice of immutable build packages. These builds can be promoted without a need to make modification in the actual code to adapt to a changing environment.


CSS Modules with Webpack 4

Ok, I know what you are going to say. We have heard of modules with Programming languages, but modules in CSS. Is that even possible? and why do you need it at first place? Well, I had a similar reaction when I heard about it. CSS Modules were born out of the idea of relentless hours spent in debugging issues caused by overlapping CSS selectors, class names. It is a common practice of having multiple style declarations spread across CSS files. The web projects include multiple CSS files to define common layout appearance, widgets etc. This sometimes becomes a nightmare when you have multiple CSS files sharing same class selector.