-1

In the code for my bundle configuration, assume the following is declared and initialised:

BundleCollection bundles;

I have js files that I want to include in the following directories:

  1. ~/Scripts/app
  2. ~/Scripts/app/some-namespace

I've been able to include the files in the app directory but not its child directories by using this:

bundles.Add(new ScriptBundle("~/bundles/app").Include("~/Scripts/app/*.js"));

I would like to include all of the js files from both directories in a single bundle in the most maintainable way possible.

Sam
  • 40,644
  • 36
  • 176
  • 219

1 Answers1

2

I was able to achieve this by doing this:

var appScripts = new ScriptBundle("~/bundles/app")
    .IncludeDirectory("~/Scripts/app", "*.js", searchSubdirectories: true);
bundles.Add(appScripts);
Sam
  • 40,644
  • 36
  • 176
  • 219