UPDATE: After some time the bundling works fine, dont know what it was )
In my BundleConfig.cs I have these bundles defined
public static void RegisterBundles(BundleCollection bundles)
{
bundles.Add(new ScriptBundle("~/bundles/vendor").Include(
"~/Scripts/jquery-{version}.js",
"~/Scripts/bootstrap.js",
"~/Scripts/bootstrap-datetimepicker.js",
"~/Scripts/es6-shim.js",
"~/Scripts/toastr.js",
"~/Scripts/angular.js",
"~/Scripts/angular-route.js",
"~/Scripts/highcharts.src.js",
"~/Scripts/highcharts-ng.js",
"~/Scripts/angular-block-ui.js",
"~/Scripts/angular-translate.js"));
bundles.Add(new ScriptBundle("~/bundles/app").Include(
"~/Scripts/app/app.js",
"~/Scripts/app/directives.js",
"~/Scripts/app/translation.js",
"~/Scripts/app/data.service.js",
"~/Scripts/app/main.controller.js",
"~/Scripts/app/parameters.controller.js",
"~/Scripts/app/schedules.controller.js",
"~/Scripts/app/settings.controller.js",
"~/Scripts/app/subscriptions.controller.js"));
}
In my Index.cshtml file I have this sequence of adding these bundles
@Scripts.Render("~/bundles/vendor")
@Scripts.Render("~/bundles/app")
If in web.config
<compilation debug="true" targetFramework="4.5">
I have correct bundle sequence
If I change debug to false
<compilation debug="false" targetFramework="4.5">
the sequence is broken, and the app doesnt work!
Why is this happening? How to fix?


<script>elements. Please post your rendered HTML.@Scripts.Render("~/bundles/app")can be messed up due to having same name (app) as script placeholder directory name~/Scripts/app. Try renaming bundle name afterbundlespart.