I wonder why bundling
doesn't work. Here is my scenario. I use foundation
framework for my front-end. Now, I include foundation.js
, foundation.magellan.js
. It works fine if I declare it like this.
<script src="~/Scripts/foundation.js"></script>
<script src="~/Scripts/foundation.magellan.js"></script>
<script>
$(document).foundation();
</script>
And this is what it renders:
But then I tried something like, (this doesn't work)
bundles.Add(new ScriptBundle("~/bundles/foundationjs").Include("~/Scripts/foundation.js"));
bundles.Add(new ScriptBundle("~/bundles/foundationsupport").Include("~/Scripts/foundation.magellan.js"));
And then render then like this:
@Scripts.Render("~/bundles/foundationjs")
@Scripts.Render("~/bundles/foundationsupport")
<script>
$(document).foundation();
</script>
And this is what it renders:
I tried to look if it returns a 404 error but it didn't. I tried clicking the button which clearly didn't work. How can I resolve this using bundling?
Any help would be much appreciated!