To add SCSS support to your NPM project, you can follow these steps:
Install the node-sass package using npm:
npm install node-sass --save-dev
Create an SCSS file in your project directory, for example styles.scss.
In your project's package.json file, add the following lines to the "scripts" section:
"scripts": {
"scss": "node-sass --watch styles.scss styles.css"
},
This sets up a script called scss that watches for changes to your styles.scss file and compiles it to styles.css.
Run the script by entering the following command in your terminal:
npm run scss
This will start the node-sass watcher and compile your SCSS file to CSS whenever changes are made.
Link the generated CSS file in your HTML or other project files.
<link rel="stylesheet" href="styles.css">
With these steps, you should now have SCSS support in your NPM project.