1234567891011121314151617181920212223242526272829303132 |
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Web;
- using System.Web.Optimization;
- namespace PMS.WebUI
- {
- public class BundleConfig
- {
- //压缩js & css
- public static void RegisterBundles(BundleCollection bundles)
- {
- ResetIgnorePatterns(bundles.IgnoreList);
-
- //启用了压缩,设置为false为不启用,压缩,可以调试
- BundleTable.EnableOptimizations = true;
- }
- public static void ResetIgnorePatterns(IgnoreList ignoreList)
- {
- ignoreList.Clear();
- ignoreList.Ignore("*.intellisense.js");
- ignoreList.Ignore("*-vsdoc.js");
- ignoreList.Ignore("*.debug.js", OptimizationMode.WhenEnabled);
- //ignoreList.Ignore("*.min.js", OptimizationMode.WhenDisabled);
- ignoreList.Ignore("*.min.css", OptimizationMode.WhenDisabled);
- }
- }
- }
|