When I publish a website created with the ASP.NET Core website template to Azure, why are the changes I've made in site.css and site.js not published too?
The reason for this is that, despite the presence of the bundleconfig.json file in the solution (which defines that the site.cs and site.js files should be bundled and minified), there isn't actually a minifier installed in the template projects by default, meaning the files site.css.min and site.js.min files are not actually being updated.
You can verify that by expanding the site.css node in the Solution Explorer in VS an comparing site.css to site.min.css.
To get the minification working, you need to add an extension and a NuGet package by doing the following:
For more details see Bundling and Minification section of the ASP.NET Core docs.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With