.NET Core MVC base project with support for Sass using Webpack that includes minification and autoprefixing CSS for production.
Although this is a Core app, the same principles apply to a ASP.NET MVC app. You would just need to modify the Webpack configuration a little bit to output the CSS file to the Content
directory.
You will need to have Node and NPM installed. You will also need NPM Task Runner.
Open Command Prompt, clone this repo and cd into the project to install JavaScript dependencies
git clone https://github.com/esausilva/netcore-sass-webpack.git
cd netcore-sass-webpack\netcore-sass-webpack
npm i
After installing dependencies, double click netcore-sass-webpack.sln
to open the project in Visual Studio.
Follow the tutorial: https://esausilva.com/2018/08/30/compile-sass-files-visual-studio-webpack/
If you would like to support my work and the time I put into making tutorials, consider getting me a coffee by clicking on the image below. I would really appreciate it!
-Esau