使用.net mvc BundleConfig为Angular 1.3.9仅使用ngAnimate时出现缩小错误

时间:2017-07-10 09:14:32

标签: c# asp.net angularjs minify bundling-and-minification

我们正在开发一个大型ASP.net MVC 4 + Angular应用程序。在过去的几个月中,缩小/捆绑似乎已经破裂。

这是我们收到的错误:

/* Minification failed. Returning unminified contents.
    (27211,145-152): run-time error JS1019: Can't have 'break' outside of loop: break a
*/

我已将错误追踪到ngAnimate,我们正在使用https://code.angularjs.org/1.3.9/angular-animate.min.js

中的缩小版本

这就是我们BundleConfig.cs中的BundleScripts方法的样子:

bundles.Add(new ScriptBundle("~/bundles/app.js").Include(
            "~/Content/js/vendor/modernizr-2.8.3/modernizr.js",
            "~/Content/js/vendor/jquery-1.11.1/jquery.min.js",
            "~/Content/js/vendor/angular-1.3.9/angular.min.js",
            "~/Content/js/vendor/angular-1.3.9/i18n/angular-locale_sv-se.js",
            "~/Content/js/vendor/angular-1.3.9/angular-animate.min.js",
            "~/Content/js/vendor/angular-1.3.9/angular-touch.min.js",
            "~/Content/js/vendor/fastclick/lib/fastclick.js",
            "~/Content/js/vendor/ui-bootstrap-2.4.0/ui-bootstrap-tpls.js")
            .Include("~/Content/js/vendor/clipboardjs-1.6.1/clipboard.min.js")
            .Include("~/Content/js/vendor/ngclipboard-1.1.1/ngclipboard.min.js")
            .IncludeDirectory("~/Content/js/vendor/ui-bootstrap-2.4.0-sb", "*.js", true)
            .Include("~/Content/js/runfirst.js")
            .IncludeDirectory("~/Content/js/app", "*.js", true)
            .Include(ClientJsConfig.BundlePath));

我尝试过的事情:

  • 评论每个项目以查看导致问题的文件
  • 更改文件的顺序
  • 使用未经过破坏的版本让Visual Studio将其缩小(

我想避免的事情:

  • 更新Angular,因为这需要测试整个网站,我们接近发布

这可能是此版本框架中的错误吗? 您建议使用什么解决方案来解决此错误?

感谢任何帮助!

0 个答案:

没有答案
相关问题