Reputation: 43
Hello everyone, I have to work on angular app that every aspect in styling will be dynamic and will be loaded from json file to help the end user manage has style and customize has theme in the run time he will be change colors , padding , margin ...etc after building the angular app that will be in the production mood.
after searching results I found that the best library was jsontosass that will help me to convert the json to scss variables and use these varibales to style my components.
jsontosass convert the json to scss variables theme but I should run this command line in my termainal to listen for every change in the json file the command was npm run jsontosass
after running this command line every changes in the json will be transfare to the theme.scss file.
my question is :
What is the best way to run this command line npm run jsontosass
after building my angular app ?
I need to give the end user ability to change in the json then run this command line to listen for the changes in json to be converted to theme.scss
thank you!
Upvotes: 0
Views: 1765
Reputation: 13356
You can add a script in your package.json
"scripts": {
"build": "ng build && npm run jsontosass"
}
And you build your app by typing:
npm run build
Upvotes: 3