.Net Core MVC project is integrated with Webpack and Gulp (see available tasks):
*.scss
files within src/
directory are processed by node-sass. Output files will have the next filename format: {filename}.css
. Example:Note: You can use the below SCSS file to write your own custom style.
body{
background-color: #fafafa;
}
src\site.scss
files will be processed and generate css files at wwwroot\css\site.css
.scss
files except site.scss
, will be processed and generate css files at wwwroot\vendor\libs
folder.<environment include="Development"><link rel="stylesheet" href="~/css/site.css" /></environment>
<environment exclude="Development"><link rel="stylesheet" href="~/css/site.css" asp-append-version="true" /></environment>
.js
files within wwwroot/
directory are processed by Webpack. Output files will have the next filename format: {filename}.js
. Example:Note: You can use the below site.js
file to write your own custom script.
$(() => {
alert('Alert Success!')
})
wwwroot/js/*.js
files are used directly for the template and do not require processing. Consequently, any updates or changes in site.js
will be directly reflected in the template, as it is independent of webpack processing tasks.src\js\*.js
files will be processed and generated js files as wwwroot\vendor\js\*.js
.<environment include="Development"><script src="~/js/site.js"></script></environment>
<environment exclude="Development"><script src="~/js/site.js" asp-append-version="true"></script></environment>