简体   繁体   中英

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>

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?

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM