ligershark / WebOptimizer

A bundler and minifier for ASP.NET Core
Apache License 2.0
750 stars 113 forks source link

Working Source Map emit for JavaScriptBundle #311

Closed b9chris closed 1 month ago

b9chris commented 1 month ago

Enables the creation of Source Maps for Javascript Bundles.

Program.cs example:

services.AddWebOptimizer(pipeline =>
{
    . . .   
    pipeline.AddJavaScriptBundle("/js/bundle.js",
        new WebOptimizer.Processors.JsSettings { GenerateSourceMap = true },
        "/ui/crud/jquery-3.7.1.js", "/ui/all/bootstrap/bootstrap.bundle.js");
});

Generates a /js/bundle.js bundle containing jquery and bootstrap, with a sourcemap at /js/bundle.map.js Chrome Dev Tools properly finds and loads it.

madskristensen commented 1 month ago

Thanks

b9chris commented 3 days ago

Thank you!