简体   繁体   中英

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?

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.

I've tried Transforms.Clear() , but apparently that only applies to minification.

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

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

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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