WebOptimizer icon indicating copy to clipboard operation
WebOptimizer copied to clipboard

Not minifying my bundle at all

Open MeikelLP opened this issue 4 years ago • 2 comments

I have the following bundle

services.AddWebOptimizer(pipeline =>
{
    pipeline.AddJavaScriptBundle("/js/vendor.js",
        new[]
        {
            "/lib/js/vue.js",
            "/lib/js/filepond-plugin-file-validate-type.js", 
            "/lib/js/filepond.js",
            "/lib/js/bootstrap.bundle.js", 
            "/lib/js/jquery.js", 
            "/lib/js/tom-select.complete.js",
            "/lib/js/vuejs-dialog.min.js", 
            "/lib/js/vue-filepond.js", 
            "/lib/js/iziToast.js"
        });
});

Sadly it does not bundle my files. I tried everything. CodeSettings, MinifyJavascript() or a global MinifyScript = true.

I tried a manual bundle AddBundle but it has the same result.

I noticed that when I have a bundle with only 1 file the minification does work.

MeikelLP avatar Oct 22 '21 10:10 MeikelLP

I have also discovered this issue. I also tried supplying the overload for CodeSettings

` pipeline.AddJavaScriptBundle( route: $"{PathConstants.CDNOutputRoot}/player-combined.min.js", new NUglify.JavaScript.CodeSettings() { LocalRenaming = NUglify.JavaScript.LocalRenaming.KeepLocalizationVars, MinifyCode = true, }, sourceFiles: new string[]{ "/Player/js/1.js", "/Player/js/2.js", "/Player/js/3.all.js", "/Player/js/4.JS", "/Player/js/5.js" });

`

uprightbass360 avatar Nov 24 '21 18:11 uprightbass360

I'm assuming that also didn't work right @uprightbass360 ?

milkmanmatty avatar Mar 24 '22 03:03 milkmanmatty