简体   繁体   English

仅对某些目录启用捆绑优化

[英]Enable Bundling Optimization Only for Certain Directories

Is it possible with .NET bundling to only bundle certain JS files, preferably by using a wildcard to filter directories? .NET捆绑是否可以仅捆绑某些JS文件,最好使用通配符筛选目录?

During debug mode, I would like to view all the individual files, not all the files combined into one. 在调试模式下,我想查看所有单个文件,而不是所有组合在一起的文件。

I have to keep BundleTable.EnableOptimizations set to true to enable Angular template caching. 我必须将BundleTable.EnableOptimizations设置为true才能启用Angular模板缓存。

I've tried Transforms.Clear() , but apparently that only applies to minification. 我已经尝试过Transforms.Clear() ,但显然仅适用于缩小。

Maybe something similar to what this guy is doing, but with out having to install the VS plugin https://github.com/madskristensen/BundlerMinifier/wiki/Unbundling-scripts-for-debugging 也许与这个人正在做的事情类似,但是不必安装VS插件https://github.com/madskristensen/BundlerMinifier/wiki/Unbundling-scripts-for-debugging

You can disable Bundle Optimization in debug mode and when you deploy your application using release mode it will enable automatically. 您可以在调试模式下禁用捆绑优化,当您使用发布模式部署应用程序时,它将自动启用。 Just add the following line at the end of RegisterBundles method in BundleConfig.cs 只需在BundleConfig.cs中RegisterBundles方法的末尾添加以下行

#if !DEBUG
     BundleTable.EnableOptimizations = true;
#endif

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM