Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Web Essentials - Bundle versioning

I'm currently using Visual Studio Web Essentials in order to bundle and minify my CSS and JavaScript files.

At present I'm manually creating the bundles with a version number (e.g. mybundle-1.0.0.css) in order to avoid caching issues when pushed out to production. I'm also having to manually change the bundle files version number each time a change is made to the source.

Is there any sort of automatic versioning functionality in Web Essentials bundling that I may have overlooked?

The ideal workflow would be:

  1. Developer updates a source file.
  2. Web essentials updates the bundle automatically.
  3. Web essentials increments the version number in the filename automatically.

Is this possible?

If not, I'd be happy to hear any suggestions for better developer workflows.

like image 264
Brett Postin Avatar asked Jan 09 '13 13:01

Brett Postin


1 Answers

Web Essentials doesn't have any support for dynamic versioning. Instead, I always use a dynamic runtime feature to automatically append fingerprints to my JS and CSS references. This works better for me, because it is completely independent of any build process or tooling support, instead it just looks at the actual files for changes. So it's much more robust.

I just wrote it up in a blog post here

like image 131
Mads Kvist Kristensen Avatar answered Oct 23 '22 11:10

Mads Kvist Kristensen