Giter Club home page Giter Club logo

sbt-stylus's Introduction

sbt-less-plugin

Allows less to be used from within sbt. Builds on com.typesafe:js-engine in order to execute the less compiler along with the scripts to verify. js-engine enables high performance linting given parallelism and native JS engine execution.

To use this plugin use the addSbtPlugin command within your project's plugins.sbt (or as a global setting) i.e.:

addSbtPlugin("com.typesafe" % "sbt-less-plugin" % "1.0.0-M1")

Then declare the settings required in your build file (LessPlugin depends on some other, more generalised settings to be defined). For example, for build.sbt:

import com.typesafe.web.sbt.WebPlugin
import com.typesafe.jse.sbt.JsEnginePlugin
import com.typesafe.jshint.sbt.LessPlugin

WebPlugin.webSettings

JsEnginePlugin.jsEngineSettings

LessPlugin.lessSettings

The compiler allows most of the same options to be specified as the less compiler itself. A complete list of options are:

  • silent: Suppress output of error messages. Defaults to false.
  • verbose: Be verbose. Defaults to false.
  • ieCompat: Do IE compatibility checks. Defaults to true.
  • compress: Compress output by removing some whitespaces. Defaults to false.
  • cleancss: Compress output using clean-css. Defaults to false.
  • includePaths: The include paths to search when looking for LESS imports.
  • sourceMap: Outputs a v3 sourcemap. Defaults to true.
  • sourceMapLessInline: Whether to embed the less code in the source map. Defaults to false.
  • sourceMapFileInline: Whether the source map should be embedded in the output file. Defaults to false.
  • sourceMapRootpath: Adds this path onto the sourcemap filename and less file paths.
  • maxLineLen: Maximum line length. Defaults to no maximum.
  • strictMath: Requires brackets. This option may default to true and be removed in future. Defaults to false.
  • strictUnits: Whether all unit should be strict, or if mixed units are allowed. Defaults to false.
  • strictImports: Whether imports should be strict. Defaults to false.
  • optimization: Set the parser's optimization level. Defaults to 1.
  • color: Whether LESS output should be colorised. Defaults to whether SBT coloring is enabled or not.
  • insecure: Allow imports from insecure https hosts. Defaults to false.
  • rootpath: Set rootpath for url rewriting in relative imports and urls.
  • relativeUrls: Re-write relative urls to the base less file. Defaults to false.

At present the only supported engine is Node. In-jvm options should become available soon. To use Node declare the following in your build file:

import com.typesafe.jse.sbt.JsEnginePlugin.JsEngineKeys

JsEngineKeys.engineType := JsEngineKeys.EngineType.Node

node is required to be available on your shell's path in order for it to be used. To check for its availability simply type node.

© Typesafe Inc., 2013

sbt-stylus's People

Contributors

jamesward avatar

Stargazers

Angus H. avatar Joe Zulli avatar

Watchers

 avatar James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.