Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Reconciling ASP.NET script bundles and source maps

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?

like image 714
Mihai Avatar asked Dec 06 '13 18:12

Mihai


People also ask

What is BundleConfig Cs in ASP NET MVC?

By default, the MVC application's BundleConfig (located inside App_Start folder) comes with the following code − public static void RegisterBundles(BundleCollection bundles) { // Following is the sample code to bundle all the css files in the project // The code to bundle other javascript files will also be similar to ...

What is bundling & Minification?

Bundling and minification are two techniques you can use in ASP.NET 4.5 to improve request load time. Bundling and minification improves load time by reducing the number of requests to the server and reducing the size of requested assets (such as CSS and JavaScript.)

What is the benefit of bundling .JS scripts into one file?

JavaScript bundling is an optimization technique you can use to reduce the number of server requests for JavaScript files. Bundling accomplishes this by merging multiple JavaScript files together into one file to reduce the number of page requests.


1 Answers

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.

like image 50
Mihai Avatar answered Sep 25 '22 00:09

Mihai