I have ASP.NET MVC 4 application that contains library of some simple jQuery widgets. Now I want to allow other web applications to use that library. Instead of inserting every widget file by file on client page it would be good to load all of them as a bundle at one request. Does anybody know is it possible to do that bundle using Microsoft ASP.NET Web Optimization Framework? In other words I want to prepare some “jquery-library-1.0.0.js” file and allow other application load it.
All I can find is how to use it inside MVC application and nothing about how to prepare bundle with the static name.
after some research I found the way how to do this – using IBundleTransform interface. It allows to get access to the bundle content and I just need to dump it to the disk in the place where I want and use it later for any other applications that want to use the library.
and after that I just need to add this transformer in the bundle config to the bundle that I want to dump to the disk:
Even if any widget in the library will be changed, dump file will be regenerated automatically and I don’t have manually control this process.