Copied to clipboard

Flag this post as spam?

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


  • Gianni Declercq 2 posts 72 karma points
    1 week ago
    Gianni Declercq
    0

    MVC Bundles not working Umbraco 8

    I'm trying to use an MVC BundleConfig for my CSS and Scripts. But in release mode I always get a 404 not found when loading these assets.

    My bundleconfig:

    public static void RegisterBundles(BundleCollection bundles)
    {
        bundles.Add(new ScriptBundle("~/bundles/jquery").Include(
                    "~/Scripts/jquery-{version}.js"));
    
        bundles.Add(new ScriptBundle("~/bundles/js/iziModal.min.js", 
            "https://cdnjs.cloudflare.com/ajax/libs/izimodal/1.5.1/js/iziModal.min.js").Include(
            "~/assets/js/iziModal.min.js"));
    
        bundles.Add(new ScriptBundle("~/bundles/js").Include(
              "~/assets/js/main.js", "~/assets/js/vendor.js"));
    
        bundles.Add(new StyleBundle("~/bundles/css").Include(
                    "~/assets/css/main.css"));
    
        #if DEBUG
                BundleTable.EnableOptimizations = false;
        #else
                BundleTable.EnableOptimizations = true;
        #endif
    }
    

    I also registered the config at startup

    BundleConfig.RegisterBundles(BundleTable.Bundles);
    

    And..

    <add key="Umbraco.Core.ReservedPaths" value="~/.well-known/,~/bundles/" />
    

    What am I doing wrong here?

  • Yakov Lebski 311 posts 1204 karma points
    1 week ago
    Yakov Lebski
    0

    How you call RegisterBundles ?

Please Sign in or register to post replies

Write your reply to:

Draft