Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • John Sharp 20 posts 110 karma points
    May 13, 2021 @ 13:39
    John Sharp
    1

    Disable Smidge/Minification/Bundling

    Is there a right or proper way to disable Smidge during development. I've looked in as many places as I can think of to turn it off but all files referenced in package.manifest still appear to be pushed through it.

  • Adam Hearn 13 posts 109 karma points
    May 17, 2021 @ 12:16
    Adam Hearn
    0

    Good question; I'd also like to know this and also where Smidge logging can be enabled for trying to trace why minification is failing.

  • Adam Hearn 13 posts 109 karma points
    May 17, 2021 @ 23:34
    Adam Hearn
    0

    In response to my own query - Smidge logging isn't as detailed as could be but what is there is generated at Debug level and is managed by the Serilog config block in appSettings.

  • David Houghton 10 posts 100 karma points
    May 24, 2022 @ 18:01
    David Houghton
    0

    Hi John,

    did you get down to the bottom of this at all? I'm having an issue with Smidge throwing an exception when trying to minify an Umbraco Forms css file, and would like to turn of the minification for production as a temporary fix, but haven't had any joy so far...

    Cheers,

    Dave

  • kjmitch 3 posts 73 karma points
    May 24, 2022 @ 22:16
    kjmitch
    0

    I didn't realize when I replied that yours was the only post here from this May. Hopefully someone else gets some use out of my suggestion for turning Smidge off for development.

    I looked around and found a small amount of info on Smidge in Umbraco:

    Part of the page on working with CSS and JS files

    Page on configuring Smidge in Umbraco project files that doesn't have much

    I feel like these resources aren't much, but that might just be Umbraco/Smidge not providing as many options for configuration as I'd expect.

    Additionally, the wiki page for installation and configuration in the Smidge repository may be a good place to start; the documentation still seems to make assumptions about what the reader already knows, but it's better than I remember it being before.

  • John Sharp 20 posts 110 karma points
    May 25, 2022 @ 10:34
    John Sharp
    0

    Hi David,

    I did pretty much the same ad kjmitch did and added my own css files directly to pages. The Smidge engine was too aggressive and black-box for me to get too far into without some properly expensive tooling to stop it. FWIW, the investigation I did at the time suggested there was little or no option to turn it off without serious downsides to the OOTB Umbraco experience.

  • kjmitch 3 posts 73 karma points
    May 24, 2022 @ 21:49
    kjmitch
    0

    What I've done is commented out all Smidge calls and added the appropriate <link> and <script> tags for my CSS and JS files in my .cshtml files, just in the places they would normally go if Smidge weren't part of my project at all. Doing this effectively side-steps Smidge (along with its aggressive caching and filename obfuscation) for the time being, allowing me to edit my CSS and then refresh the page to see results like I expect to while I'm still writing and debugging my files.

    Later, when I've got most stuff working and it won't get in the way of my development process so much, I plan to uncomment the Smidge calls and remove the tags I've added to explicitly link in my CSS and JS files. That way I can take advantage of Smidge without needing to understand how to configure it. If you don't want to start using it again later, you could just remove the calls to Smidge entirely, but I suspect it's useful enough not to just toss it out without knowing what you're tossing.

    I also plan to read deep into Smidge's documentation and figure that stuff out later on, but for now it feels like the docs I've seen are only helpful for people who already know the answers to the questions I have.

  • Marc Love (uSkinned.net) 430 posts 1668 karma points
    May 25, 2022 @ 12:51
    Marc Love (uSkinned.net)
    1

    Hi,

    To disable smidge bundling and minification on the frontend of your site when developing you can use tag helpers:

    <environment names="Staging,Production">
    <link rel="stylesheet" href="YOURBUNDLE" />
    </environment>
    
    <environment names="Development">
     <link rel="stylesheet" href="YOURBUNDLE" media="screen" debug="true"/>
    </environment>
    

    Notice debug=true within the Development tag helper

    Hope that helps.

    Cheers,

    Marc

Please Sign in or register to post replies

Write your reply to:

Draft