admin管理员组文章数量:1391934
I have problem with asp MVC4 javascript bundles. All is working and it's OK, but js code is only minimized and NOT obfuscated. Is there anything I can do in .NET, or should I get back to my own bundling and minification system based on YUI pressor?
I have problem with asp MVC4 javascript bundles. All is working and it's OK, but js code is only minimized and NOT obfuscated. Is there anything I can do in .NET, or should I get back to my own bundling and minification system based on YUI pressor?
Share Improve this question edited Sep 4, 2013 at 10:51 dado89 asked Sep 4, 2013 at 10:45 dado89dado89 781 silver badge7 bronze badges 2- Have you looked at or used nuget/packages/YUICompressor.NET? I'm not aware of the ASP.NET bundling including obfuscation. – MikeSmithDev Commented Sep 4, 2013 at 14:10
- I used it in earlier versions of MVC, but I believed that I won't need it anymore with asp MVC 4 where bundling and minification was presented, looks like I was wrong, I found solution now in nuget/packages/BundleTransformer.Yui/1.8.0 – dado89 Commented Sep 6, 2013 at 11:55
3 Answers
Reset to default 3Actually I installed this nuget package https://www.nuget/packages/BundleTransformer.Yui/1.8.0 Works excellent. Saved me some time.
Here is some explanation about bundling and minification in some quick notes.
Bundling picks all the scripts/css files and puts them in a single file to make less HTTP requests when loading a page.
Minification deletes all useless characters like: spaces, newlines, etc. to decrease file size.
Obfuscation pick the readable css or js files and makes it unreadable for the human eye making it more difficult to copy.
So for obfuscation in .Net i reend: http://www.nuget/packages/BundleTransformer.UglifyJs/
In file App_Start\BundleConfig method RegisterBundles at the end add the following code:
BundleTable.EnableOptimizations = true;
Also make sure that bundling and minimizations are not disabled from the configuration file.
本文标签: javascriptASPNET MVC 4 bundles minification OK but there is NO obfuscationStack Overflow
版权声明:本文标题:javascript - ASP.NET MVC 4 bundles minification OK but there is NO obfuscation - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1744715304a2621366.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论