System.Web.Optimization making function argument names stay the same for certain functions

后端 未结 3 795
时光说笑
时光说笑 2021-01-06 03:52

With ASP.NET Bundling with a ScriptBundle

function StartController($scope, $location, $rootScope) {}

is transformed to

func         


        
3条回答
  •  甜味超标
    2021-01-06 04:34

    This isn't something you can change on the built in bundle types, as we currently don't expose any knobs that you can tweak on the underlying transform classes. The best way to accomplish this is to write your own IBundleTransform which does minification passing in the appropriate settings to not rename variables.

    I.e. something like:

    public class CustomTransform : IBundleTransform {
        public void process(BundleContext context, BundleResponse response) {
             response.Content = MyMinifier.MinifyWithoutRename(response.Content);
        }
    }
    
    BundleTable.Bundles.Add(new Bundle("~/bundles/mybundle", new CustomTransform());
    

提交回复
热议问题