Copied to clipboard

Flag this post as spam?

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


  • Tom Bruce 77 posts 348 karma points
    1 week ago
    Tom Bruce
    0

    Hi everyone, I cannot get my bundle to work. I am using Umbraco version 7.6.3 assembly: 1.0.6361.21154.

    I have created folder called App_Start within my project. I have added a class within the folder called BundleConfig.cs

    Class code

    public class BundleConfig : IApplicationEventHandler
    {
        public void OnApplicationInitialized(UmbracoApplicationBase umbracoApplication,
        ApplicationContext applicationContext)
        { }
    
        public void OnApplicationStarting(UmbracoApplicationBase umbracoApplication,
           ApplicationContext applicationContext)
        {
            //Scripts
            BundleTable.Bundles.Add(new ScriptBundle("~/bundles/jquery").Include(
               "~/scripts/jquery.min.js",
               "~/scripts/jquery.easing.1.3.js",
               "~/scripts/bootstrap.min.js",
               "~/scripts/jquery.waypoints.min.js",
               "~/scripts/main.js"
               ));
    
            //CSS
            BundleTable.Bundles.Add(new StyleBundle("~/bundles/style").Include(
               "~/css/animate.css",
               "~/css/icomoon.css",
               "~/css/simple-line-icons.css",
               "~/css/bootstrap.css",
               "~/css/style.css",
               "~/css/BootstrapOveride.css",
               "~/Content/font-awesome.min.css"
               ));
        }
    
        public void OnApplicationStarted(UmbracoApplicationBase umbracoApplication, ApplicationContext applicationContext)
        { }
    }
    

    I have also added the following code to the appSettings within the webconfig

     <add key="umbracoReservedPaths" value="~/umbraco,~/install/,~/bundles/" />
    

    I have also set the debug to false within the webconfig any pointers much appreciated.

  • Dave Woestenborghs 2411 posts 6839 karma points mvp c-trib
    1 week ago
    Dave Woestenborghs
    0

    Hi Tom,

    What is the problem with your bundle ? Is not rendering anything or just not bundled and minified ?

    Dave

  • Dave Woestenborghs 2411 posts 6839 karma points mvp c-trib
    1 week ago
    Dave Woestenborghs
    0

    By the way...I once created a package that allows you to main your bundles through a config file :

    https://our.umbraco.org/projects/developer-tools/booteasy-client-bundling/

  • Steve Morgan 826 posts 2419 karma points c-trib
    1 week ago
    Steve Morgan
    0

    Hi,

    Have you added a Global.asax.cs file and changed the Global.asax to reference it?

    <%@ Application Inherits="YOURNAMESPACE.Global" Language="C#" %>

    That's the bit I always forget to do :)

    These references help:

    Steve

  • Tom Bruce 77 posts 348 karma points
    1 week ago
    Tom Bruce
    0

    Hi everyone, my bundle looks like it's being fired with I step through the debugger, but still no CSS or JS

    When I viewed the page source code the bundles are empty

    <link href="/bundles/css" rel="stylesheet"/>
    

    enter image description here

  • Steve Morgan 826 posts 2419 karma points c-trib
    1 week ago
    Steve Morgan
    100

    You've named the bundle /bundles/style

    So hit that in the browser - does that work?

  • Tom Bruce 77 posts 348 karma points
    1 week ago
    Tom Bruce
    0

    Thanks Steve and thank you everyone for your help much appreciated :)

  • Steve Morgan 826 posts 2419 karma points c-trib
    1 week ago
    Steve Morgan
    0

    You're very welcome! Glad to help - definitely been there - amazing what a fresh pair of eyes does to your sanity!

Please Sign in or register to post replies

Write your reply to:

Draft