MVC Bundling - Include .min file for a single bundle

試著忘記壹切 提交于 2019-12-30 05:20:06

问题


I have a single file in my application that I only have a minified version of and I would like to create a bundle for it:

bundles.Add(new ScriptBundle("~/bundles/maskedinput").Include(
    "~/Scripts/jquery.maskedinput-1.3.min.js"));

The problem is that by default in debug mode, the bundling mechanism ignores .min files. I don't want to turn off this rule for all bundles, but I would like to disable it for this single bundle. Is this possible?


回答1:


A quick fix is to rename the js file taking out .min. Or as per the solution in this link you can create your own ignore patterns.

https://stackoverflow.com/a/12005272/1593273




回答2:


This is also fixed in the 1.1-alpha1 release, so if you update to that version, you should no longer see this behavior when including files explicitly.




回答3:


You can either rename the file without the .min, or you can copy the file to have both a .min and one without. It's just that they're now both the same.



来源:https://stackoverflow.com/questions/13290977/mvc-bundling-include-min-file-for-a-single-bundle

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!