This doc currently recommends using @madskristensen's BundlerMinifier packages, but this project is no longer being actively maintained. We should remove this recommendation from the docs for now, and consider what guidance we want to replace it with in the future.
⚠Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.
Per @madskristensen:
A better and more modern alternative is to use the LigerShark WebOptimizer (does LESS/Sass compilation too) NuGet packages, but it needs maintenance as well, though it is in a much better state. It was developed with guidance from Damian and Fowler and is pretty cool. My suggestion is that you consider taking ownership or allocate ongoing resources to the LigerShark WebOptimizer and recommend it over Bundler & Minifier in the docs and templates. Alternatively, don’t recommend any of these two projects and go with a 3rd option which could be to not recommend anything.
My vote is we recommend nothing and list LigerShark WebOptimizer in the More resources section.
I'm not sure trying to solve this only with .NET is the way to go. I've needed to do bundling and minification myself in a Razor Pages project. Instead of trying to solve the whole problem with .NET I got Razor Pages working with Webpack.
I've open sourced it as I think others might find it useful.
https://github.com/DalSoft/DalSoft.RWC/
All you need to do is add <webpack /> to your layout page and any page you want to do bundling in. That's it, you have all power and flexibility of Webpack without trying to build Webpack in .NET.
The updated nuget package does work with Core 3.1, but I now use modern JS syntax, like spread operator inside an object literal, which the nuget package croaks on, and bombs. So, I'll look for another option.
But since you did remove the wording about the package from the doc, I guess you need to remove the wording that says: "In ASP.NET Core 2.1 or later, add a new JSON file, named bundleconfig.json......Build the application. Open site.min.css and notice the content of custom.css is appended to the end of the file."
...because it's not automatic without having the package.
Most helpful comment
Per @madskristensen:
My vote is we recommend nothing and list LigerShark WebOptimizer in the More resources section.