Copied to clipboard

Flag this post as spam?

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


  • Richard Brisley 1 post 22 karma points
    Oct 04, 2014 @ 22:17
    Richard Brisley
    0

    Implementing NSASS

    Just been setting up NSASS on Umbraco and thought I would let you know the changes that I had to make. This hopefully will save someone some time if they go to implement it.

    Modify this web.config to ignore ~/bundles (I start all my bundles like this http://localhost/bundles/modernizr for instance, if you use something else than add these in here instead.)

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

    Add this to http modules

        <remove name="BundleModule" />

              <add type="System.Web.Optimization.BundleModule" name="BundleModule" />

    This to httphandlers

    <add name="NSassHandler" verb="GET" path="*.scss" type="NSass.SassHandler, NSass.Handler" />

    All pretty standard the bit that really had me bashing my head against the wall is Umbracos Global.asax. You need to inherit from Umbraco.Web.UmbracoApplication which is the class the global.asax uses by default. Then add a protected onapplication_start so you can register your bundles BundleConfig.RegisterBundles

    protected override void OnApplicationStarted(object sender, EventArgs e)

            {

                LogHelper.Info<Global>("Application_Start has begun");

                RegisterGlobalFilters(GlobalFilters.Filters);

                BundleConfig.RegisterBundles(BundleTable.Bundles);

                LogHelper.Info<Global>("Application_Start has finished");

                base.OnApplicationStarted(sender, e);

            }

    The rest is the standard setup after that.

    Best Regards

    Richard

Please Sign in or register to post replies

Write your reply to:

Draft