1.0.18
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();
}