How to inject variables into SCSS before compilation?


I want to inject variables in my SCSS file trough JavaScript before compilation (by fetching a configuration from an API endpoint) any change I could alter the compilation process of my #ionic-2 project?

I have found this resource and want to use it together with the Ionic architecture. Are the other (smarter) ways to achieve this?