Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/spring-boot/5.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
停止压缩JavaScript文件_Javascript_C#_Asp.net_Minify_Cassette - Fatal编程技术网

停止压缩JavaScript文件

停止压缩JavaScript文件,javascript,c#,asp.net,minify,cassette,Javascript,C#,Asp.net,Minify,Cassette,我们正在使用它在C#ASP.NET MVC5项目中压缩和缩小JavaScript文件 但是,其中一个依赖项使用eval按名称调用某些函数,这在管道缩小捆绑包时会导致错误 我找到了,但我需要在CASEv2中配置单个捆绑包,使其不缩小 当前配置为: public void Configure(BundleCollection bundles) { bundles.Add<ScriptBundle>("~/bundles/uicomponents", new[] { "~/Scri

我们正在使用它在C#ASP.NET MVC5项目中压缩和缩小JavaScript文件

但是,其中一个依赖项使用eval按名称调用某些函数,这在管道缩小捆绑包时会导致错误

我找到了,但我需要在CASEv2中配置单个捆绑包,使其不缩小

当前配置为:

public void Configure(BundleCollection bundles)
{
    bundles.Add<ScriptBundle>("~/bundles/uicomponents", new[] { "~/Scripts/bridge/UIComponents.js" })
}
public void配置(BundleCollection bundles)
{
bundles.Add(“~/bundles/uicomponents”,new[]{”~/Scripts/bridge/uicomponents.js})
}

谢谢

经过一周的尝试,只有我自己做的事情,我才能够找到答案。通过使用“customizeBundle”参数,您可以自定义默认盒式磁带管道集合,以移除缩微器:

        bundles.Add<ScriptBundle>("~/bundles/uicomponents", new[] { $"~/Scripts/bridge/UIComponents.js" },
            b =>
            {
                var minifyidx = b.Pipeline.IndexOf<MinifyAssets>(); //Don't want to re-minify scripts
                if (minifyidx >= 0) { b.Pipeline.RemoveAt(minifyidx); } //Remove the object from the cassette pipeline
            }
            );
bundles.Add(“~/bundles/uicomponents”,new[]{$”~/Scripts/bridge/uicomponents.js},
b=>
{
var minifyidx=b.Pipeline.IndexOf();//不想重新缩小脚本
如果(minifyidx>=0){b.Pipeline.RemoveAt(minifyidx);}//从盒式磁带管道中删除对象
}
);
非常感谢所有帮助回答这个问题的人,希望这能帮别人省去头疼