Include all files in a folder in a single bundle

前端 未结 1 820
别跟我提以往
别跟我提以往 2020-12-01 02:47

When using BundleConfig is it possible to include all files of a folder including all the files of the childfolders (and their childfolders etc.)?

I fou

相关标签:
1条回答
  • 2020-12-01 03:07

    Use the overload of IncludeDirectory method which accepts bool searchSubdirectories as third parameter.

    MSDN:

    searchSubdirectories - Specifies whether to recursively search subdirectories of directoryVirtualPath.

    Example:

    bundles.Add(new ScriptBundle("~/bundles/scripts")
        .IncludeDirectory("~/Scripts", "*.js", true));
    
    0 讨论(0)
提交回复
热议问题