Style bundling for MVC4 not using min files

前端 未结 3 1967
失恋的感觉
失恋的感觉 2020-12-28 20:03

I have 4 files:

  • a.css
  • a.min.css
  • b.css
  • b.min.css

they are added to bundle in following way:

bundles.Ad         


        
3条回答
  •  感动是毒
    2020-12-28 20:36

    Your actual question is not answerable because it is already acting as documentation states (which is why I asked what documentation you were looking it, but you have chosen to ignore my comment).

    If you want to keep the same behavior in release mode, use BundleTable.EnableOptimizations = false; in your Global.asax. This will turn off the bundling and minification that is active in debug mode only. Then to use your own minified css / js files, simply point your bundles path to the minified versions.

    According to documentation, you could also use "~/Content/a{version}.css" which would use non-minified version in debug mode and minified version for release. However, I have not tried that.

提交回复
热议问题