Closed ashu66867 closed 3 months ago
Given that you configure AddWebbOptimizer
with a pipeline and that you are using the included taghelpers to "render" the bundle just change EnableTagHelperBundling
appropriately like this:
#if DEBUG
var useWebOptimizer = false;
#else
var useWebOptimizer = true;
#endif
services.AddWebOptimizer(
pipeline =>
{
pipeline.AddJavaScriptBundle("/bundles/js","/scripts/a.js","/scripts/b.js");
pipeline.AddCssBundle("/bundles/css","/scripts/a.css","/scripts/b.css");
},
option =>
{
option.EnableCaching = true;
option.EnableTagHelperBundling = useWebOptimizer;
});
Is it possible to disable the bundling for DEBUG mode and enable it for RELEASE mode?
I am migrating a .Net framework project, which has the below:
if DEBUG
Does WebOptimizer have any option or settings to do similar stuff?