Use virtual file system for ASP.NET Bundling & Minification
Make ASP.NET Bundling & Minification (System.Web.Optimization) using the virtual file system to support bundling and minification of virtual files.
public override IEnumerable<BundleFile> EnumerateFiles(BundleContext context)
MyVirtualPathProvider virtualPathProvider = new MyVirtualPathProvider();
IEnumerable<BundleFile> files = base.EnumerateFiles(context);
foreach (BundleFile file in files)
file.VirtualFile = virtualPathProvider.GetFile(file.IncludedVirtualPath);
You can actually accomplish this by making your own class that derives from ScriptBundle or StyleBundle then override the EnumerateFiles files method. In this method replace the VirtualFile with one obtained from your own provider. Hope this helps.
Koen Willemse commented
I hope it will be added soon, since we can't use this functionality without it.
Howard Dierking commented
We have this item on our backlog as it's definitely a capability we want to support.