This project demonstrates how to use Webpack to compile SCSS files automatically whenever changes are made.
project-root/
├── dist/
│ └── index.html
├── src/
│ ├── index.js
│ └── scss/
│ └── main.scss
├── package.json
└── webpack.config.js
Ensure you have Node.js and npm installed. If not, download and install them from Node.js official website.
Install dependencies:
npm install
npm run build
: Compile the SCSS and JavaScript files once.npm run watch
: Watch for file changes and recompile automatically.