Skip to content

Keep bundle, but disable minify not working #317

Open
@marius-kazlauskas-trimble

Description

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions