aspnet / LibraryManager

Other
447 stars 78 forks source link

[Docs] Bundle, minify, etc. #681

Closed lonix1 closed 2 years ago

lonix1 commented 2 years ago

For my simple RazorPages project, I needed a way to download js dependencies, and libman was very helpful. I'm surprised at how effortless it was to do (compared to npm, webpack, etc.)

But what about the rest of the client-side process - bundling and minifying my static assets?

Should I webpack? That would be disappointing (and might as well use webpack for everything then).

So It would be nice to have advice from other users, or an update to the docs/wiki of this repo - what tool can we use for bundling/minifying/etc. Something simple like this one, which other ASP.NET users are using.

jimmylewis commented 2 years ago

Unfortunately, this is explicitly a non-goal of libman:

Reasons NOT to use libman:

  • Developer/team likes using tools such Bower, Yarn or npm
  • For apps that uses WebPack or Browserify for module loading/bundling

Libman is attempting to fill a niche, one that we've seen a lot of customers asking for: "I don't want to have all this complicated tooling, I just want to put the library files in my project". The goal is not to replicate or compete with the more complex tooling because then libman would naturally become a very complex tool as well, no longer fulfilling the target scenario.

We don't advertise or recommend a specific solution because we see a lot of diversity being used, and the tool ecosystem is constantly evolving and changing (for example, we still compare with Bower 😬). The answer, as always, is that "it depends". This is totally a cop-out, but it's also the most accurate answer we can provide.

The ASP.NET documentation does cover this topic here but also keeps the content fairly generalized.

lonix1 commented 2 years ago

@jimmylewis Thanks for the answer, I was sort of expecting it. The client-side stuff is a real pain. I've found the only dependable solution is a system like webpack - but just to fill the needs of an average aspnet project, it's a monster.