I am trying to apply a dynamic theme to my site using less variables. Here's a simplified scenario:
You can use angular cli's ng eject command. This will eject a webpack configuration file which will give you full control on how the build commands build.
Side Note: I don't believe it's impossible to revert
ng eject, but I've read that it is not always an easy process. Especially when multiple versions have passed with the angular cli team adding/modifying functionality to the build commands.