Hi everyone.
I'm trying to implement bundling and minification (http://www.asp.net/mvc/overview/performance/bundling-and-minification), in a dynamicweb custom application.
So far i've done as you would usually do, by adding the Microsoft Asp.Net Web Optimization NuGet package, and creating a BundleConfig.cs file in the custom application. I then added a js file to a bundle like so:
public static void RegisterBundles(BundleCollection bundles)
{
BundleTable.EnableOptimizations = true; // For debugging purposes.
bundles.Add(new ScriptBundle("~/bundles/plugins/base").Include("~/Files/Templates/Designs/ExampleDesign/js/jquery-2.1.4.min.js"));
}
then in Global.asax:
public void Application_Start(object sender, EventArgs e)
{
BundleConfig.RegisterBundles(BundleTable.Bundles);
// Fires when the application is started
Dynamicweb.Frontend.GlobalAsaxHandler.Application_Start(sender, e);
}
In my master.cshtml i've put a reference to "@using System.Web.Optimization" and added the following line:
@Scripts.Render("~/bundles/plugins/base")
which, when inspecting the element, has rendered something like this:
<script src="/bundles/plugins/base?v=76AIGLyY_agf8nmHAUeHF5fo0HxMeiQhRw6ATlkJEeQ1"></script>
Because it displays a value token, i can only assume that it found the js file and created the bundle, which the Scripts.Render found and displayed the url for. The request then results in an error, which is a "Failed to load the resource: the server responded with a status of 404 (Not Found)". This is my problem.
My general experience using this this framework is that it is pretty much "plug-and-play", but dynamicweb adds an extra layer that, with my limited experience using dynamicweb, can't seem to quite wrap my head around. I've been trying to solve the problem by trying some of the common solutions suggested by a simple search, but with no luck.
Best Regards, Jeppe