Reconciling ASP.NET script bundles and source maps

↘锁芯ラ 提交于 2019-11-26 16:30:36

问题


Is there any way to set up the default System.Web.Optimization.ScriptBundle to generate source maps for the bundled and minified files? Is there an equivalent solution, other than having to pre-generate the bundles and source maps before each build?


回答1:


It looks like in the meantime some kind soul has released a custom class that does exactly what I need.

You can get his source at https://github.com/benmccallum/AspNetBundling.




回答2:


Nothing built in yet, although I wish it was. That being said, if you don't have to use the built in optimizer you could opt for Web essentials found here and use it to create bundles with map files for you. These bundles are kept up to date as you save changes to the source js files so you would not need to recreate the bundles per build.

Right click on any script file once web essentials is installed, select the web essentials option at the top of the context menu, and select minify javascript file. Alternatively you can select multiple javascript files and use web essentials to create a bundle in the same fashion.



来源:https://stackoverflow.com/questions/20431036/reconciling-asp-net-script-bundles-and-source-maps

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