For the UI/UX, I am using extension .scss and it should automatically compile into css. Why my .scss is not automatically compiling into a css file?
3 Answers
Browser will not convert .scss file into .css file. We are suppose to convert it and feed. There are many ways to convert it. One of the options is webpack. Please check if you can use it. Webpack comes with css loader, style loader.
Hope it helps.
1 Comment
Like in the comments, you will need node.js with npm or yarn to update your compiled css file. Maybe if you already have that installed, try something like yarn run dev or npm run dev. Not sure how its exactly written but I think if you search those keywords on internet you will find it out.
EDIT:
Steps you might want to take: Install node.js https://nodejs.org/en/download/ Try in console (while inside your project, in VSC use CTRL + SHIFT + ` to open console) and write something like npm run dev. (this is needed every time you want to update your css. Using npm run watch might also work, this updates everytime you save your css file (same as run dev but now automatic).
8 Comments
npm run-script: sass node-sass -w scss/ -o dist/css/ --recursive " i think, i already setup node js and when i write in scss file it should compile to css file, because inside the index.html, i link with css/main.css file, what happen is when i start live serve its nothing changeThanks who those spend time to contribute on the question i asked!! Every contribution is my stage to solve the problem
How i solve my problem is, write in terminal "npm run sass". Terminal give output of your "package.json script" and hold it blank until u change anything in sass file and save it.
Terminal will rendering your website, and your change display in browser
Hope this help someone beginner in web dev..
Parcelto compile everything at once and get an output you can use directly).