C
C#2y ago
Anton

Frontend package management in ASP.NET Core

The Microsoft docs apparently recommend libman https://learn.microsoft.com/en-us/aspnet/core/client-side/libman/?view=aspnetcore-6.0 and then using external tools for bundling and minification, https://learn.microsoft.com/en-us/aspnet/core/client-side/bundling-and-minification?view=aspnetcore-6.0 But they also have docs on using Grunt and NPM. This seems like too much work tbh, and would also require configuration duplication. What do you use usually? With all these separate tools I'd also need to maintain build scripts. Do you use Nuke for that on your job? Maybe send an example?
Client-side library acquisition in ASP.NET Core with LibMan
Learn how to install client-side library assets in an ASP.NET Core project using Library Manager (LibMan).
Bundle and minify static assets in ASP.NET Core
Learn how to optimize static resources in an ASP.NET Core web application by applying bundling and minification techniques.
7 Replies
Angius
Angius2y ago
That's funny, both Libman and Grunt fell out of favor mweh got largely replaced by NPM, while Grunt was replaced by Gulp, and layer by bundlers Personally, I use Gulp for build tasks, both for CSS and JS
Anton
Anton2y ago
Sure thanks for the advice Gulp's last update was in 2019 You're sure it's a good idea to still use it? The world's moving fast I just installed the package and got 7 vulnerability warnings
Angius
Angius2y ago
Yeah, Gulp is slowly going to shit. There's some big update planned for the unspecified future, and even some work put into it, but when it's out nobody knows And the maintainer won't lift a finger to update dependencies because of that
Anton
Anton2y ago
Seems like a bad idea to use it
Angius
Angius2y ago
And because it's a dev tool that doesn't make it to production, so all the vulnerabilities are fair game apparently
Anton
Anton2y ago
any alternatives you can suggest?
Angius
Angius2y ago
I haven't found anything else that would count as a plain taks runner It's all bundlers nowadays