SASS with Node.js
Description
Create Node.js project which compiles SASS file to minfied CSS file.
Software Requirements
- Node.js
- Visual Studio Code (VS Code)
Steps
- Open Terminal
- Create project directory mkdir sass-project
- Enter into the sass-project folder cd sass-project
- Configure project npm init –yes
- Install SASS npm install sass –save-dev
- Open the project folder in VS Code code .
- Close Terminal using command exit
- In the VS Code, create folder scss
- In the scss folder, create file style.scss and add some scss code to it for testing
- Now open package.json and add script for compiling many to many file concept
- “sass”: “sass –stop-on-error –watch scss:css –style=compressed”
- Then open Terminal in VS Code and run the command npm run sass
- You can see the compiled version of css file along with map file was generated in css folder
Repository
https://github.com/gtvcreations/sass-project