Exemplo n.º 1
0
        public static void RegisterBundles(BundleCollection bundles)
        {
            bundles.IgnoreList.Clear();
            BundleTable.Bundles.ResetAll();
            BundleTable.EnableOptimizations = !HttpContext.Current.IsDebuggingEnabled;

            RegisterContentBundles(bundles);
            RegisterScriptBundles(bundles);

            bundles.ForEach(b => b.Orderer = new SyncBundleOrder());
        }
Exemplo n.º 2
0
        public static BundleCollection ApplyHashCache(this BundleCollection bundleCollection, bool addHashToPath = true,
                                                      bool useServerCache = false, HttpCacheability httpCacheability = HttpCacheability.NoCache, string hashPathParameterName = null)
        {
            var transform = new HashCacheTransform()
            {
                AddHashToPath         = addHashToPath,
                HttpCacheability      = httpCacheability,
                HashPathParameterName = hashPathParameterName,
                UseServerCache        = useServerCache
            };

            bundleCollection.ForEach(bundle => bundle.Transforms.Add(transform));
            return(bundleCollection);
        }