Force or configure versioning of css/js files

Topics: General
Oct 13, 2012 at 10:38 AM
Edited Oct 13, 2012 at 10:39 AM

Many nuget packages do not install with version numbers.

Instead of:
filename-1.2.3.min.css (and similarly for js),

we actually get:

This does not work (nicely or easily) with MVC4 bundling and minification, and makes it hard overall to use. Typically we just have to include manually, and update manually every time there is an update (and thus cannot use nuget for these sort of libraries).

Is there any sense in forcing authors to use version numbers, or if that is draconian then at least allowing the user the ability to modify/configure the installed files through the package manager or Visual Studio or something?

There are so many such packages, it's truly saddening, we would love to use nuget for all of them!

Oct 16, 2012 at 9:59 PM

Hello BugMeNot2,

Addressing this problem to each of the owners of the packages you're concerned about might yield the best results.

Having said that, I think you'll find that you can still use NuGet to install the packages and then manually re-name them after update.  Is this solution problematic?  (I really want to understand your scenario.)


Oct 16, 2012 at 10:41 PM

It's not problematic, but it's not automatic.

The idea behind nuget is that there is no need to manage import of libraries, dependencies, etc. But since the filenames don't play nice with bundling, one needs to change them, which negates the benefits of nuget. So we end up managing those css/js libraries the old fashioned way.

It would be awesome if there were some way to override defaults for specific nuget packages. For example, specify that the "foocss" package should have its files renamed to [%filename%.%version%.%extension] where those tokens are from the nuget package. This would be done every time the package is updated. And this is better than the default of [%filename%..%extension] which the package author specified.