jeudi 23 juillet 2020

SASS: How to substitute imports before build (Ember project)

I have Ember JS project and the main scss file (app.scss), I have an ENV variable (STYLE_NAME).

I need to replace the content of app.scss pasting @import 'STYLE_NAME'; Where STYLE_NAME - a string from process.env.STYLE_NAME;

I have lot of 'STYLE_NAME' scss files in the same folder.

so, by executing the console command "env STYLE_NAME=theme1 ember build", I need to get app.scss with the following content:

...
...
...

@import 'theme1';
@import 'main'; // this import is always the last one



Aucun commentaire:

Enregistrer un commentaire