I'm trying to use
To minify and bundle my css and js files
All the examples I have been able to find all include all of their scripts on the masterpage / _layout file.
I would like to be able to have a
@RenderSection("Script", false)
in my _layout file and add scripts from my "subviews" like this
@section Script {
<script src="@Url.Content("~/Scripts/Configuration/Configuration.js")" type="text/javascript"></script>
}
Now my question is how I dynamically add files to the bundle and force a cache bust?
Right now i have this
public static void AddBundleFile(this HtmlHelper helper, string path, Type type, int index)
{
var bundle = BundleTable.Bundles.GetRegisteredBundles()
.Where(b => b.TransformType == type)
.First();
bundle.AddFile(path);
}
To add files from my "subviews" but the bundle files is never updated..