Skip to content

1.0.18

Compare
Choose a tag to compare
@stefanprodan stefanprodan released this 02 Mar 12:08
· 230 commits to master since this release
New in RequireJS.NET v1.0.18
  • Added optional parameter urlArgs to RenderRequireJsSetup methods

You can use urlArgs to append the app version value to each of the script urls for cache busting.

Setup:

@Html.RenderRequireJsSetup(
    baseUrl: Url.Content("~/Scripts"),
    requireUrl: Url.Content("~/Scripts/require.js"),
    urlArgs: MvcRenders.RenderAppVersion(),
    configPath: Server.MapPath("~/RequireJS.release.config"))

App version helper:

public static string RenderAppVersion()
{
    return "v=" + System.Reflection.Assembly.GetExecutingAssembly().GetName().Version.ToString();
}