MVC4 bundle template error
I am stuck with bundles in MVC4. I have defined a bundle
bundles.Add(new ScriptBundle("~/bundles/maps").Include("~/Scripts/map.*.js"));
and scripts
map.base.js
map.helper.js
It was ok until I added
map.setting.js
After that I get the error
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}.
Parameter name: virtualPaths
Any ideas how to solve this without listing all the files (I expect to add more with the "map." Prefix)?
Thanks for the help.
+3
Andree
source
to share
1 answer
It just seems like an annoying limitation of the current Bundle version.
You can write:
.Include("~/Scripts/map.*")
Of course it can pick up ~/Scripts/map.a.txt
(not sure, haven't tested this edge). As long as you only have .js resources in the given path, it map.*
is safe.
+6
Eric J.
source
to share