Running tasks
Just because we are now working in C# it does not mean we do not have any frontend worries anymore. We still need to minify, bundle, Browserify, and many more. We can handle minification and bundling in .NET. For Browserify, we will need Gulp again. First, take a look at the bundleconfig.json
file. It contains some bundling and minification information that is handled by .NET:
// Configure bundling and minification for the project. // More info at https://go.microsoft.com/fwlink/?LinkId=808241 [ { "outputFileName": "wwwroot/css/site.min.css", // An array of relative input file paths. Globbing patterns supported "inputFiles": [ "wwwroot/css/site.css" ] }, [...] ]
To get this to work, we first need to install the BundlerMinifier.Core
tool. You can do this by manually editing your csproj
file and adding a reference to the BundlerMinifier.Core
tool:
<ItemGroup> <PackageReference Include="BundlerMinifier.Core" Version="2.4.337"...