Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Keep bundle, but disable minify not working #317

Open
marius-kazlauskas-trimble opened this issue Jul 28, 2024 · 0 comments
Open

Keep bundle, but disable minify not working #317

marius-kazlauskas-trimble opened this issue Jul 28, 2024 · 0 comments

Comments

@marius-kazlauskas-trimble
Copy link

marius-kazlauskas-trimble commented Jul 28, 2024

I am using Blazor (Server Side Rendering). I want to keep bundles, but disable minify. I have tried 3 different methods with no success:

  1. Result: Bundle: Yes, but Minify is still ON
builder.Services.AddWebOptimizer(
    builder.Environment,
    new CssBundlingSettings { Minify = false },
    new CodeBundlingSettings { Minify = false },
    option =>
    {
        option.EnableCaching = true;
        option.EnableDiskCache = false;
        option.EnableMemoryCache = true;
        option.AllowEmptyBundle = true;
    },
    pipeline =>
    {
        pipeline.AddCssBundle("css/bundle.css", "css/a.css", "css/b.css");
        pipeline.AddJavaScriptBundle(
            "js/bundle.js",
            "javascript/a.js",
            "javascript/b.js"
        );
    }
);
  1. Result: Bundle: No, Minify: No
builder.Services.AddWebOptimizer(minifyJavaScript: false, minifyCss: false);

builder.Services.AddWebOptimizer(
    pipeline =>
    {
        pipeline.AddCssBundle("css/bundle.css", "css/a.css", "css/b.css");
        pipeline.AddJavaScriptBundle(
            "js/bundle.js",
            "javascript/a.js",
            "javascript/b.js"
        );
    },
    option =>
    {
        option.EnableCaching = true;
        option.EnableDiskCache = false;
        option.EnableMemoryCache = true;
        option.AllowEmptyBundle = true;
    }
);
  1. Result: Bundle: Yes, Minify: Yes
builder.Services.AddWebOptimizer(
    pipeline =>
    {
        pipeline.AddCssBundle("css/bundle.css", "css/a.css", "css/b.css");
        pipeline.AddJavaScriptBundle(
            "js/bundle.js",
            "javascript/a.js",
            "javascript/b.js"
        );
    },
    option =>
    {
        option.EnableCaching = true;
        option.EnableDiskCache = false;
        option.EnableMemoryCache = true;
        option.AllowEmptyBundle = true;
    }
);

builder.Services.AddWebOptimizer(minifyJavaScript: false, minifyCss: false);

Maybe there is some other way how keep bundle, but disable minify? I need this, because I need to keep bundles in my dev env.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant