Documentation Menu

Bundles

Loading jsnlog.js as part of a bundle

ASP.NET's bundling feature optimizes loading of your CSS and JavaScripot files in Release mode. It does this by using minified versions of the files and combining them in bundles.

You can add jsnlog.js to any bundle, or put it in its own bundle. The NuGet package installs both jsnlog.js and the minified jsnlog.min.js. That way, the bundling feature can pick the right version depending on whether the site runs in Debug mode or Release mode.

Assuming that you intend to load both jQuery and JSNLog in every page, you could add jsnlog.js to the jquery bundle in your BundleConfig class:

bundles.Add(new ScriptBundle("~/bundles/jquery")
       .Include("~/Scripts/jquery-{version}.js")
       .Include("~/Scripts/jsnlog.js"));