MVC4捆绑模式错误
问题描述:
我被捆绑在MVC4中。我已经定义捆绑MVC4捆绑模式错误
bundles.Add(new ScriptBundle("~/bundles/maps").Include("~/Scripts/map.*.js"));
和脚本
map.base.js
map.helper.js
这是确定的,直到我加入
map.setting.js
在那之后我歌厅错误
Invalid pattern: 'map.*.js'. Wildcards are only allowed in the last path segment, can contain only one leading or trailing wildcard, and cannot be used with {version}.
参数名称:virtualPaths
任何想法如何解决这个问题,而不列出所有的文件(我期望添加更多的“地图”。前缀)?
感谢您的帮助。
答
这似乎是当前Bundle版本的一个恼人的限制。
你可以写:
.Include("~/Scripts/map.*")
当然也可以拿起~/Scripts/map.a.txt
(不知道,没有测试边缘的情况下)。只要你在给定路径中只有.js资源,map.*
是安全的。