3

I have few JS files which i am trying to Bundle using MVC4, the code is as follows:-

public static void RegisterBundles(BundleCollection bundles)
{
    //Global App Items go here.
    bundles.Add(new ScriptBundle("~/Scripts/modernizr")
        .Include("~/Scripts/modernizr-*"));
    bundles.Add(new ScriptBundle("~/bundles/lib")
        .Include(
            "~/Scripts/jquery.js",
            "~/Scripts/jquery.unobtrusive*",
            "~/Scripts/jquery.validate*",
            "~/Scripts/jquery-ui*",
            "~/Scripts/jquery.tablesorter.js"));

    bundles.Add(new StyleBundle("~/content/bootstrap")
        .Include("~/Content/bootstrap.css"));

    var lessBundle = new Bundle("~/content/myApp").Include(
        "~/Content/jqueryMultiSelect.less",                
        "~/Content/scrollbars.css");
    lessBundle.Transforms.Add(new LessTransform());
    lessBundle.Transforms.Add(new CssMinify());
    bundles.Add(lessBundle);

    BundleTable.EnableOptimizations = true;
}

Now, when i see my console in Firefox, I can see my Response as Expected. But when same i do it in Chrome, the bundled file is broken.

Broken may be a non-technical term, What i mean by broken is :- enter image description here

The file is incomplete....

Please let me know, if i need to provide more detail.

4

1 回答 1

0

它实际上是显示问题。

在 chrome 中,js 文件长度是有限的,所以不能完全显示。

尝试在新选项卡中打开该文件,您将看到全部内容。

在 Firefox 中,它会提示用户在新选项卡中打开以查看完整内容。

于 2013-04-18T08:22:00.863 回答