javascriptangularjsasp.net-mvc-5scriptbundle

ASP.NET MVC Bundling Subfolders structure


I want to include javascript files from whole folder and subfolders into a single ASP.NET Bundle. The purpose of this is to load all files from that folder at once.

The idea is to create an angular application and load all app files with a single bundle.

  1. Is this idea ok ?
  2. The problem I have is that the Script tags added to HTML don't respect the subfolder strucutre of my application and the files can't be found.

Bundle config:

 bundles.Add(new ScriptBundle("~/bundles/app").IncludeDirectory(
            "~/app", "*.js", true));

Folder Structure

app
 controller/appMenu.js
 modules/navigation.js
 app.js

On client side the included tags look like this:

<script src="/app/appMenu.js"></script>
<script src="/app/navigation.js"></script>

Solution

  • I think it might be related to this: http://aspnetoptimization.codeplex.com/workitem/105

    What version of the System.Web.Optimizations assembly are you using?