Copied to clipboard

Flag this post as spam?

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


  • Henrik Sunesen 84 posts 281 karma points
    Dec 28, 2021 @ 11:23
    Henrik Sunesen
    1

    Hey all,

    I have some issues with Smidge on my Umbraco 9 solution. When i'm working on it locally and make some changes in the css/js files. I need to rebuild it before it's visible in the browser (normally a refresh is working). I can't find a lot of info about smidge with umb 9. So i hope someone can help me out.

    appsettings.json

    "RuntimeMinification": {
        "UseInMemoryCache": false,
        "CacheBuster": "Timestamp" //I have tried all the three values here (Version, AppDomain and Timestamp)
      },
    

    My .cshtml file

    @using Umbraco.Cms.Web.Common.PublishedModels;
    @inherits Umbraco.Cms.Web.Common.Views.UmbracoViewPage
    @using Smidge
    @{
    Layout = null;
    SmidgeHelper.CreateJsBundle("inline-js-bundle").RequiresJs("~/scripts/jquery.js", "~/scripts/bootstrap.js", "~/scripts/script.js");
    SmidgeHelper.CreateCssBundle("inline-css-bundle").RequiresCss("~/css/bootstrap.min.css", "~/css/style.min.css");
    }
    <!DOCTYPE html>
    <html lang="da">
    <head>
    
    @await SmidgeHelper.JsHereAsync("inline-js-bundle")
    @await SmidgeHelper.CssHereAsync("inline-css-bundle")
    <title>Page Title</title>
    
    </head>
    <body>
    @RenderBody()
    
     </body>
     </html>
    

    Any suggestions here?

  • AvihayBit 149 posts 303 karma points
    Jan 23, 2022 @ 07:09
    AvihayBit
    0

    Hi, did you find a solution for this? I'm facing exactly the same situation here...

  • Henrik Sunesen 84 posts 281 karma points
    Jan 24, 2022 @ 20:57
    Henrik Sunesen
    101

    Hi AvihayBit

    I got it working doing the following.

    Setting the debug parameter = true:

    @using Smidge
    @{
       Layout = null;
    SmidgeHelper.CreateJsBundle("inline-js-bundle").RequiresJs("~/scripts/jquery.js");
    SmidgeHelper.CreateCssBundle("inline-css-bundle").RequiresCss("~/css/bootstrap.min.css");
    }
    <!DOCTYPE html>
    <html lang="da">
    <head>
    
    @await SmidgeHelper.JsHereAsync("inline-js-bundle",true)
    @await SmidgeHelper.CssHereAsync("inline-css-bundle",true)
    </head>
    

    The following packages installed: Smidge & Smidge.Core

    appsettings.json:

     "RuntimeMinification": {
            "UseInMemoryCache": false,
            "CacheBuster": "Version"
          }
    

    I hope this will help you.

  • AvihayBit 149 posts 303 karma points
    Jan 24, 2022 @ 21:29
    AvihayBit
    1

    Sorry, I don't see how it solves the problem you described.

    When I use it like you did - the files are combined and minified even when debug parameter = true...

Please Sign in or register to post replies

Write your reply to:

Draft