Skip to content
This repository has been archived by the owner on Nov 28, 2018. It is now read-only.
/ Cassette.LessJs Public archive
forked from elerch/Cassette.LessJs

Version of the Less compiler for Cassette.Net using the original Js Libraries

Notifications You must be signed in to change notification settings

okb/Cassette.LessJs

 
 

Repository files navigation

Cassette.LessJs

NOT MAINTAINED

Version of the Less compiler for Cassette.Net using the original Js Libraries

Cassette.Less uses dotless. This is a great library and supports mono, but is based on an older version of Less.

This library implements a Less compiler using the windows script host version of less.js for windows. This strictly limits usage to Windows OS, but has the advantage of matching the implementation of less compilation in the Web Essentials Visual Studio extension.

OKB Note:

The compiler needs file acces to write the resources to disc before running the compiler. this might pose a consern for some.

##Usage NancyFx:

Add this method to the project your bootstrapper resides in. It will add the assembly to cassettes assemblyscan. wich is a separate container than Nancys container.

using Nancy.Bootstrapper;
namespace Web.Registrations
{
public class CassetteNancyPluginRegistrations : ApplicationRegistrations
    {
        public CassetteNancyPluginRegistrations()
        {
            AppDomainAssemblyTypeScanner.AddAssembliesToScan(assembly => assembly.FullName.Contains("Cassette.LessJs"));
        }
    }
}

##Usage MVC

To use it, add the DLL to your project and replace the Less configuration with the corresponding LessJs configuration

###Old

container.Register(Cassette.Stylesheets.ILessCompiler, Cassette.Stylesheets.LessCompiler).AsMultiInstance();
container.Register(typeof(Cassette.IFileSearchModifier<Cassette.Stylesheets.StylesheetBundle>),
                Cassette.Stylesheets.LessFileSearchModifier)).AsSingleton();

###New

container.Register(Cassette.Stylesheets.ILessJsCompiler, Cassette.Stylesheets.LessJsCompiler).AsMultiInstance();
container.Register(typeof(Cassette.IFileSearchModifier<Cassette.Stylesheets.StylesheetBundle>),
                Cassette.Stylesheets.LessJsFileSearchModifier)).AsSingleton();

About

Version of the Less compiler for Cassette.Net using the original Js Libraries

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • C# 100.0%