BundleConfig.cs 949 B

1234567891011121314151617181920212223242526272829303132
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Web;
  5. using System.Web.Optimization;
  6. namespace PMS.WebUI
  7. {
  8. public class BundleConfig
  9. {
  10. //压缩js & css
  11. public static void RegisterBundles(BundleCollection bundles)
  12. {
  13. ResetIgnorePatterns(bundles.IgnoreList);
  14. //启用了压缩,设置为false为不启用,压缩,可以调试
  15. BundleTable.EnableOptimizations = true;
  16. }
  17. public static void ResetIgnorePatterns(IgnoreList ignoreList)
  18. {
  19. ignoreList.Clear();
  20. ignoreList.Ignore("*.intellisense.js");
  21. ignoreList.Ignore("*-vsdoc.js");
  22. ignoreList.Ignore("*.debug.js", OptimizationMode.WhenEnabled);
  23. //ignoreList.Ignore("*.min.js", OptimizationMode.WhenDisabled);
  24. ignoreList.Ignore("*.min.css", OptimizationMode.WhenDisabled);
  25. }
  26. }
  27. }